From 4685373d5b214e85e838177b5f67dc69c775daf1 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Sep 03 2019 03:41:20 +0000 Subject: - Refresh patches.suse/0001-NFS-flush-out-dirty-data-on-file-fput.patch. - Refresh patches.suse/0001-NFSv4-don-t-let-hanging-mounts-block-other-mounts.patch. - NFS: Allow multiple connections to NFSv4.0 servers (fate#322786). - Refresh patches.suse/nfs-set-acl-perm.patch. - Delete patches.suse/0001-NFSv4-handle-EINVAL-from-EXCHANGE_ID-better.patch. - Delete patches.suse/0001-SUNRPC-Allow-creation-of-RPC-clients-with-multiple-c.patch. - Delete patches.suse/0001-sunrpc-include-sup-groups-in-hash.patch. - Delete patches.suse/0002-NFS-Add-a-mount-option-to-specify-number-of-TCP-conn.patch. - Delete patches.suse/0003-NFSv4-Allow-multiple-connections-to-NFSv4.x-x-0-serv.patch. - Delete patches.suse/0004-pNFS-Allow-multiple-connections-to-the-DS.patch. - Delete patches.suse/0005-NFS-Display-the-nconnect-mount-option-if-it-is-set.patch. - Delete patches.suse/0007-SUNRPC-Mask-XIDs-to-prevent-replay-cache-collision.patch. - Delete patches.suse/NFS-optional-NFSv4_2-fix.patch. - Delete patches.suse/NFS-optional-NFSv4_2.patch. - Delete patches.suse/d-lookup-fairness.fix. - Delete patches.suse/getcwd-close-race-with-d_move-called-by-lustre.patch. - Delete patches.suse/sunrpc-cache-handle-missing-listeners-better.patch. - Delete patches.suse/vfs-use-synchronize_rcu_expedited-in-namespace_unlock.patch. --- diff --git a/patches.suse/0001-NFS-flush-out-dirty-data-on-file-fput.patch b/patches.suse/0001-NFS-flush-out-dirty-data-on-file-fput.patch index 0bce231..3d1d26a 100644 --- a/patches.suse/0001-NFS-flush-out-dirty-data-on-file-fput.patch +++ b/patches.suse/0001-NFS-flush-out-dirty-data-on-file-fput.patch @@ -42,7 +42,7 @@ Acked-by: NeilBrown --- a/fs/nfs/file.c +++ b/fs/nfs/file.c -@@ -81,6 +81,12 @@ nfs_file_release(struct inode *inode, st +@@ -82,6 +82,12 @@ nfs_file_release(struct inode *inode, st { dprintk("NFS: release(%pD2)\n", filp); diff --git a/patches.suse/0001-NFSv4-don-t-let-hanging-mounts-block-other-mounts.patch b/patches.suse/0001-NFSv4-don-t-let-hanging-mounts-block-other-mounts.patch index b35a499..fd7f1e4 100644 --- a/patches.suse/0001-NFSv4-don-t-let-hanging-mounts-block-other-mounts.patch +++ b/patches.suse/0001-NFSv4-don-t-let-hanging-mounts-block-other-mounts.patch @@ -37,12 +37,12 @@ Acked-by: NeilBrown --- a/fs/nfs/nfs4client.c +++ b/fs/nfs/nfs4client.c -@@ -481,7 +481,7 @@ static int nfs4_match_client(struct nfs_ +@@ -505,7 +505,7 @@ static int nfs4_match_client(struct nfs_ * remaining fields in "pos", especially the client * ID and serverowner fields. Wait for CREATE_SESSION * to finish. */ - if (pos->cl_cons_state > NFS_CS_READY) { + if (pos->cl_cons_state == NFS_CS_SESSION_INITING) { - atomic_inc(&pos->cl_count); + refcount_inc(&pos->cl_count); spin_unlock(&nn->nfs_client_lock); diff --git a/patches.suse/0001-NFSv4-handle-EINVAL-from-EXCHANGE_ID-better.patch b/patches.suse/0001-NFSv4-handle-EINVAL-from-EXCHANGE_ID-better.patch deleted file mode 100644 index 0c3863c..0000000 --- a/patches.suse/0001-NFSv4-handle-EINVAL-from-EXCHANGE_ID-better.patch +++ /dev/null @@ -1,43 +0,0 @@ -From: NeilBrown -Date: Fri, 16 Mar 2018 10:28:51 +1100 -Subject: [PATCH] NFSv4: handle EINVAL from EXCHANGE_ID better. -Patch-mainline: Submitted, 16-Mar-2018 - linux-nfs@vger.kernel.org -References: bsc#1074661 - -nfs4_proc_exchange_id() can return -EINVAL if the server -reported NFS4INVAL (which I have seen in a packet trace), -or nfs4_check_cl_exchange_flags() exchange flags detects -a problem. -Each of these mean that NFSv4.1 later cannot be use, but -they should not prevent fallback to NFSv4.0. - -Currently this EINVAL error is returned by nfs4_proc_exchange_id() to -nfs41_discover_server_trunking(), and thence to -nfs4_discover_server_trunking(). -nfs4_discover_server_trunking() doesn't understand EINVAL, so converts -it to EIO which causes mount.nfs to think something is horribly wrong -and to give up. - -It would be a more graceful failure if nfs4_discover_server_trunking() -mapped -EINVAL to -EPROTONOSUPPORT - a failure to negotiate a client -ID clearly shows that NFSv4.1 cannot be supported, but isn't as -general a failure as EIO. - -Signed-off-by: NeilBrown -Acked-by: NeilBrown - ---- - fs/nfs/nfs4state.c | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/fs/nfs/nfs4state.c -+++ b/fs/nfs/nfs4state.c -@@ -2178,6 +2178,8 @@ again: - clnt = clp->cl_rpcclient; - goto again; - -+ case -NFS4ERR_INVAL: -+ /* Server confused - assume this minor isn't supported */ - case -NFS4ERR_MINOR_VERS_MISMATCH: - status = -EPROTONOSUPPORT; - break; diff --git a/patches.suse/0001-SUNRPC-Allow-creation-of-RPC-clients-with-multiple-c.patch b/patches.suse/0001-SUNRPC-Allow-creation-of-RPC-clients-with-multiple-c.patch deleted file mode 100644 index a385c7a..0000000 --- a/patches.suse/0001-SUNRPC-Allow-creation-of-RPC-clients-with-multiple-c.patch +++ /dev/null @@ -1,88 +0,0 @@ -From: Trond Myklebust -Date: Fri, 28 Apr 2017 13:25:31 -0400 -Subject: [PATCH] SUNRPC: Allow creation of RPC clients with multiple - connections -Patch-mainline: Submitted, linux-nfs@vger.kernel.org -References: fate#322786 - -Add an argument to struct rpc_create_args that allows the specification -of how many transport connections you want to set up to the server. - -Signed-off-by: Trond Myklebust -Acked-by: NeilBrown - ---- - include/linux/sunrpc/clnt.h | 1 + - net/sunrpc/clnt.c | 17 ++++++++++++++++- - net/sunrpc/xprtmultipath.c | 3 +-- - 3 files changed, 18 insertions(+), 3 deletions(-) - ---- a/include/linux/sunrpc/clnt.h -+++ b/include/linux/sunrpc/clnt.h -@@ -120,6 +120,7 @@ struct rpc_create_args { - u32 prognumber; /* overrides program->number */ - u32 version; - rpc_authflavor_t authflavor; -+ u32 nconnect; - unsigned long flags; - char *client_name; - struct svc_xprt *bc_xprt; /* NFSv4.1 backchannel */ ---- a/net/sunrpc/clnt.c -+++ b/net/sunrpc/clnt.c -@@ -522,6 +522,8 @@ struct rpc_clnt *rpc_create(struct rpc_c - .bc_xprt = args->bc_xprt, - }; - char servername[48]; -+ struct rpc_clnt *clnt; -+ int i; - - if (args->bc_xprt) { - WARN_ON_ONCE(!(args->protocol & XPRT_TRANSPORT_BC)); -@@ -584,7 +586,15 @@ struct rpc_clnt *rpc_create(struct rpc_c - if (args->flags & RPC_CLNT_CREATE_NONPRIVPORT) - xprt->resvport = 0; - -- return rpc_create_xprt(args, xprt); -+ clnt = rpc_create_xprt(args, xprt); -+ if (IS_ERR(clnt) || args->nconnect <= 1) -+ return clnt; -+ -+ for (i = 0; i < args->nconnect - 1; i++) { -+ if (rpc_clnt_add_xprt(clnt, &xprtargs, NULL, NULL) < 0) -+ break; -+ } -+ return clnt; - } - EXPORT_SYMBOL_GPL(rpc_create); - -@@ -2576,6 +2586,10 @@ int rpc_clnt_test_and_add_xprt(struct rp - return -ENOMEM; - data->xps = xprt_switch_get(xps); - data->xprt = xprt_get(xprt); -+ if (rpc_xprt_switch_has_addr(data->xps, (struct sockaddr *)&xprt->addr)) { -+ rpc_cb_add_xprt_release(data); -+ goto success; -+ } - - cred = authnull_ops.lookup_cred(NULL, NULL, 0); - task = rpc_call_null_helper(clnt, xprt, cred, -@@ -2585,6 +2599,7 @@ int rpc_clnt_test_and_add_xprt(struct rp - if (IS_ERR(task)) - return PTR_ERR(task); - rpc_put_task(task); -+success: - return 1; - } - EXPORT_SYMBOL_GPL(rpc_clnt_test_and_add_xprt); ---- a/net/sunrpc/xprtmultipath.c -+++ b/net/sunrpc/xprtmultipath.c -@@ -50,8 +50,7 @@ void rpc_xprt_switch_add_xprt(struct rpc - if (xprt == NULL) - return; - spin_lock(&xps->xps_lock); -- if ((xps->xps_net == xprt->xprt_net || xps->xps_net == NULL) && -- !rpc_xprt_switch_has_addr(xps, (struct sockaddr *)&xprt->addr)) -+ if (xps->xps_net == xprt->xprt_net || xps->xps_net == NULL) - xprt_switch_add_xprt_locked(xps, xprt); - spin_unlock(&xps->xps_lock); - } diff --git a/patches.suse/0001-sunrpc-include-sup-groups-in-hash.patch b/patches.suse/0001-sunrpc-include-sup-groups-in-hash.patch deleted file mode 100644 index d3ebeda..0000000 --- a/patches.suse/0001-sunrpc-include-sup-groups-in-hash.patch +++ /dev/null @@ -1,71 +0,0 @@ -From: NeilBrown -Subject: [PATCH] sunrpc: use supplimental groups in auth hash. -Patch-mainline: not yet, under development -References: bsc#1012917 - -Some sites vary some supplimental groups a lot. -To avoid unduely long hash chains, include all of these -in the hash calculcation. - -Also use hash_32 as it provides better results on 3.0 kernels. - -Signed-off-by: NeilBrown -Acked-by: NeilBrown - ---- - net/sunrpc/auth_generic.c | 17 ++++++++++++++--- - net/sunrpc/auth_unix.c | 17 ++++++++++++++--- - 2 files changed, 28 insertions(+), 6 deletions(-) - ---- a/net/sunrpc/auth_generic.c -+++ b/net/sunrpc/auth_generic.c -@@ -81,9 +81,20 @@ static struct rpc_cred *generic_bind_cre - static int - generic_hash_cred(struct auth_cred *acred, unsigned int hashbits) - { -- return hash_64(from_kgid(&init_user_ns, acred->gid) | -- ((u64)from_kuid(&init_user_ns, acred->uid) << -- (sizeof(gid_t) * 8)), hashbits); -+ u32 uid = from_kuid(&init_user_ns, acred->uid); -+ u32 gid; -+ int ret = hash_32(uid, 32); -+ -+ if (acred->group_info) { -+ int g; -+ -+ for (g = 0; g < acred->group_info->ngroups; g++) { -+ gid = from_kgid(&init_user_ns, acred->group_info->gid[g]); -+ ret = hash_32(ret ^ gid, 32); -+ } -+ } -+ gid = from_kgid(&init_user_ns, acred->gid); -+ return hash_32(ret ^ gid, hashbits); - } - - /* ---- a/net/sunrpc/auth_unix.c -+++ b/net/sunrpc/auth_unix.c -@@ -47,9 +47,20 @@ unx_destroy(struct rpc_auth *auth) - static int - unx_hash_cred(struct auth_cred *acred, unsigned int hashbits) - { -- return hash_64(from_kgid(&init_user_ns, acred->gid) | -- ((u64)from_kuid(&init_user_ns, acred->uid) << -- (sizeof(gid_t) * 8)), hashbits); -+ u32 uid = from_kuid(&init_user_ns, acred->uid); -+ u32 gid; -+ int ret = hash_32(uid, 32); -+ -+ if (acred->group_info) { -+ int g; -+ -+ for (g = 0; g < acred->group_info->ngroups && g < UNX_NGROUPS; g++) { -+ gid = from_kgid(&init_user_ns, acred->group_info->gid[g]); -+ ret = hash_32(ret ^ gid, 32); -+ } -+ } -+ gid = from_kgid(&init_user_ns, acred->gid); -+ return hash_32(ret ^ gid, hashbits); - } - - /* diff --git a/patches.suse/0002-NFS-Add-a-mount-option-to-specify-number-of-TCP-conn.patch b/patches.suse/0002-NFS-Add-a-mount-option-to-specify-number-of-TCP-conn.patch deleted file mode 100644 index b85e050..0000000 --- a/patches.suse/0002-NFS-Add-a-mount-option-to-specify-number-of-TCP-conn.patch +++ /dev/null @@ -1,69 +0,0 @@ -From: Trond Myklebust -Date: Fri, 28 Apr 2017 13:25:32 -0400 -Subject: [PATCH] NFS: Add a mount option to specify number of TCP connections - to use -Patch-mainline: Submitted, linux-nfs@vger.kernel.org -References: fate#322786 - -Allow the user to specify that the client should use multiple connections -to the server. For the moment, this functionality will be limited to -TCP and to NFSv4.x (x>0). - -Signed-off-by: Trond Myklebust -Acked-by: NeilBrown - ---- - fs/nfs/internal.h | 1 + - fs/nfs/super.c | 10 ++++++++++ - 2 files changed, 11 insertions(+) - ---- a/fs/nfs/internal.h -+++ b/fs/nfs/internal.h -@@ -117,6 +117,7 @@ struct nfs_parsed_mount_data { - char *export_path; - int port; - unsigned short protocol; -+ unsigned short nconnect; - } nfs_server; - - struct security_mnt_opts lsm_opts; ---- a/fs/nfs/super.c -+++ b/fs/nfs/super.c -@@ -76,6 +76,8 @@ - #define NFS_DEFAULT_VERSION 2 - #endif - -+#define NFS_MAX_CONNECTIONS 16 -+ - enum { - /* Mount options that take no arguments */ - Opt_soft, Opt_hard, -@@ -107,6 +109,7 @@ enum { - Opt_nfsvers, - Opt_sec, Opt_proto, Opt_mountproto, Opt_mounthost, - Opt_addr, Opt_mountaddr, Opt_clientaddr, -+ Opt_nconnect, - Opt_lookupcache, - Opt_fscache_uniq, - Opt_local_lock, -@@ -179,6 +182,8 @@ static const match_table_t nfs_mount_opt - { Opt_mounthost, "mounthost=%s" }, - { Opt_mountaddr, "mountaddr=%s" }, - -+ { Opt_nconnect, "nconnect=%s" }, -+ - { Opt_lookupcache, "lookupcache=%s" }, - { Opt_fscache_uniq, "fsc=%s" }, - { Opt_local_lock, "local_lock=%s" }, -@@ -1544,6 +1549,11 @@ static int nfs_parse_mount_options(char - if (mnt->mount_server.addrlen == 0) - goto out_invalid_address; - break; -+ case Opt_nconnect: -+ if (nfs_get_option_ul_bound(args, &option, 1, NFS_MAX_CONNECTIONS)) -+ goto out_invalid_value; -+ mnt->nfs_server.nconnect = option; -+ break; - case Opt_lookupcache: - string = match_strdup(args); - if (string == NULL) diff --git a/patches.suse/0003-NFSv4-Allow-multiple-connections-to-NFSv4.x-x-0-serv.patch b/patches.suse/0003-NFSv4-Allow-multiple-connections-to-NFSv4.x-x-0-serv.patch deleted file mode 100644 index f341988..0000000 --- a/patches.suse/0003-NFSv4-Allow-multiple-connections-to-NFSv4.x-x-0-serv.patch +++ /dev/null @@ -1,105 +0,0 @@ -From: Trond Myklebust -Date: Fri, 28 Apr 2017 13:25:33 -0400 -Subject: [PATCH] NFSv4: Allow multiple connections to NFSv4.x (x>0) servers -Patch-mainline: Submitted, linux-nfs@vger.kernel.org -References: fate#322786 - -If the user specifies the -onconn= mount option, and the transport -protocol is TCP, then set up connections to the server. The -connections will all go to the same IP address. - -Signed-off-by: Trond Myklebust -Acked-by: NeilBrown - ---- - fs/nfs/client.c | 2 ++ - fs/nfs/internal.h | 1 + - fs/nfs/nfs4client.c | 10 ++++++++-- - include/linux/nfs_fs_sb.h | 1 + - 4 files changed, 12 insertions(+), 2 deletions(-) - ---- a/fs/nfs/client.c -+++ b/fs/nfs/client.c -@@ -180,6 +180,7 @@ struct nfs_client *nfs_alloc_client(cons - clp->cl_rpcclient = ERR_PTR(-EINVAL); - - clp->cl_proto = cl_init->proto; -+ clp->cl_nconnect = cl_init->nconnect; - clp->cl_net = get_net(cl_init->net); - - cred = rpc_lookup_machine_cred("*"); -@@ -498,6 +499,7 @@ int nfs_create_rpc_client(struct nfs_cli - struct rpc_create_args args = { - .net = clp->cl_net, - .protocol = clp->cl_proto, -+ .nconnect = clp->cl_nconnect, - .address = (struct sockaddr *)&clp->cl_addr, - .addrsize = clp->cl_addrlen, - .timeout = cl_init->timeparms, ---- a/fs/nfs/internal.h -+++ b/fs/nfs/internal.h -@@ -78,6 +78,7 @@ struct nfs_client_initdata { - struct nfs_subversion *nfs_mod; - int proto; - u32 minorversion; -+ unsigned int nconnect; - struct net *net; - const struct rpc_timeout *timeparms; - }; ---- a/fs/nfs/nfs4client.c -+++ b/fs/nfs/nfs4client.c -@@ -839,7 +839,8 @@ static int nfs4_set_client(struct nfs_se - const size_t addrlen, - const char *ip_addr, - int proto, const struct rpc_timeout *timeparms, -- u32 minorversion, struct net *net) -+ u32 minorversion, unsigned int nconnect, -+ struct net *net) - { - struct nfs_client_initdata cl_init = { - .hostname = hostname, -@@ -854,6 +855,8 @@ static int nfs4_set_client(struct nfs_se - }; - struct nfs_client *clp; - -+ if (minorversion > 0 && proto == XPRT_TRANSPORT_TCP) -+ cl_init.nconnect = nconnect; - if (server->flags & NFS_MOUNT_NORESVPORT) - set_bit(NFS_CS_NORESVPORT, &cl_init.init_flags); - if (server->options & NFS_OPTION_MIGRATION) -@@ -1047,6 +1050,7 @@ static int nfs4_init_server(struct nfs_s - data->nfs_server.protocol, - &timeparms, - data->minorversion, -+ data->nfs_server.nconnect, - data->net); - if (error < 0) - return error; -@@ -1131,6 +1135,7 @@ struct nfs_server *nfs4_create_referral_ - rpc_protocol(parent_server->client), - parent_server->client->cl_timeout, - parent_client->cl_mvops->minor_version, -+ parent_client->cl_nconnect, - parent_client->cl_net); - if (error < 0) - goto error; -@@ -1222,7 +1227,8 @@ int nfs4_update_server(struct nfs_server - nfs_server_remove_lists(server); - error = nfs4_set_client(server, hostname, sap, salen, buf, - clp->cl_proto, clnt->cl_timeout, -- clp->cl_minorversion, net); -+ clp->cl_minorversion, -+ clp->cl_nconnect, net); - if (error != 0) { - nfs_server_insert_lists(server); - return error; ---- a/include/linux/nfs_fs_sb.h -+++ b/include/linux/nfs_fs_sb.h -@@ -55,6 +55,7 @@ struct nfs_client { - struct nfs_subversion * cl_nfs_mod; /* pointer to nfs version module */ - - u32 cl_minorversion;/* NFSv4 minorversion */ -+ unsigned int cl_nconnect; /* Number of connections */ - struct rpc_cred *cl_machine_cred; - - #if IS_ENABLED(CONFIG_NFS_V4) diff --git a/patches.suse/0004-pNFS-Allow-multiple-connections-to-the-DS.patch b/patches.suse/0004-pNFS-Allow-multiple-connections-to-the-DS.patch deleted file mode 100644 index 28ded43..0000000 --- a/patches.suse/0004-pNFS-Allow-multiple-connections-to-the-DS.patch +++ /dev/null @@ -1,42 +0,0 @@ -From: Trond Myklebust -Date: Fri, 28 Apr 2017 13:25:34 -0400 -Subject: [PATCH] pNFS: Allow multiple connections to the DS -Patch-mainline: Submitted, linux-nfs@vger.kernel.org -References: fate#322786 - -If the user specifies -onconn= mount option, and the transport -protocol is TCP, then set up connections to the pNFS data server -as well. The connections will all go to the same IP address. - -Signed-off-by: Trond Myklebust -Acked-by: NeilBrown - ---- - fs/nfs/nfs3client.c | 3 +++ - fs/nfs/nfs4client.c | 3 +++ - 2 files changed, 6 insertions(+) - ---- a/fs/nfs/nfs3client.c -+++ b/fs/nfs/nfs3client.c -@@ -100,6 +100,9 @@ struct nfs_client *nfs3_set_ds_client(st - return ERR_PTR(-EINVAL); - cl_init.hostname = buf; - -+ if (mds_clp->cl_nconnect > 1 && ds_proto == XPRT_TRANSPORT_TCP) -+ cl_init.nconnect = mds_clp->cl_nconnect; -+ - if (mds_srv->flags & NFS_MOUNT_NORESVPORT) - set_bit(NFS_CS_NORESVPORT, &cl_init.init_flags); - ---- a/fs/nfs/nfs4client.c -+++ b/fs/nfs/nfs4client.c -@@ -911,6 +911,9 @@ struct nfs_client *nfs4_set_ds_client(st - return ERR_PTR(-EINVAL); - cl_init.hostname = buf; - -+ if (mds_clp->cl_nconnect > 1 && ds_proto == XPRT_TRANSPORT_TCP) -+ cl_init.nconnect = mds_clp->cl_nconnect; -+ - if (mds_srv->flags & NFS_MOUNT_NORESVPORT) - __set_bit(NFS_CS_NORESVPORT, &cl_init.init_flags); - diff --git a/patches.suse/0005-NFS-Display-the-nconnect-mount-option-if-it-is-set.patch b/patches.suse/0005-NFS-Display-the-nconnect-mount-option-if-it-is-set.patch deleted file mode 100644 index 626847c..0000000 --- a/patches.suse/0005-NFS-Display-the-nconnect-mount-option-if-it-is-set.patch +++ /dev/null @@ -1,24 +0,0 @@ -From: Trond Myklebust -Date: Fri, 28 Apr 2017 13:25:35 -0400 -Subject: [PATCH] NFS: Display the "nconnect" mount option if it is set. -Patch-mainline: Submitted, linux-nfs@vger.kernel.org -References: fate#322786 - -Signed-off-by: Trond Myklebust -Acked-by: NeilBrown - ---- - fs/nfs/super.c | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/fs/nfs/super.c -+++ b/fs/nfs/super.c -@@ -673,6 +673,8 @@ static void nfs_show_mount_options(struc - seq_printf(m, ",proto=%s", - rpc_peeraddr2str(nfss->client, RPC_DISPLAY_NETID)); - rcu_read_unlock(); -+ if (clp->cl_nconnect > 0) -+ seq_printf(m, ",nconnect=%u", clp->cl_nconnect); - if (version == 4) { - if (nfss->port != NFS_PORT) - seq_printf(m, ",port=%u", nfss->port); diff --git a/patches.suse/0006-NFS-Allow-multiple-connections-to-NFSv3-and-NFSv4.0-.patch b/patches.suse/0006-NFS-Allow-multiple-connections-to-NFSv3-and-NFSv4.0-.patch index 943bafa..adce39f 100644 --- a/patches.suse/0006-NFS-Allow-multiple-connections-to-NFSv3-and-NFSv4.0-.patch +++ b/patches.suse/0006-NFS-Allow-multiple-connections-to-NFSv3-and-NFSv4.0-.patch @@ -1,34 +1,21 @@ From: Bennett Amodio Date: Tue, 15 Aug 2017 17:48:43 -0700 -Subject: [PATCH] NFS: Allow multiple connections to NFSv3 and NFSv4.0 servers +Subject: [PATCH] NFS: Allow multiple connections to NFSv4.0 servers Patch-mainline: Submitted, linux-nfs@vger.kernel.org References: fate#322786 -Enable nconnect mount option and multipathing behavior for NFSv3 and NFSv4. +Enable nconnect mount option and multipathing behavior for NFSv4.0. Signed-off-by: Jui-Yu Chang Acked-by: NeilBrown --- - fs/nfs/client.c | 3 +++ fs/nfs/nfs4client.c | 2 +- - 2 files changed, 4 insertions(+), 1 deletion(-) + 1 file changed, 1 insertion(+), 1 deletion(-) ---- a/fs/nfs/client.c -+++ b/fs/nfs/client.c -@@ -653,6 +653,9 @@ static int nfs_init_server(struct nfs_se - struct nfs_client *clp; - int error; - -+ if (data->nfs_server.protocol == XPRT_TRANSPORT_TCP) -+ cl_init.nconnect = data->nfs_server.nconnect; -+ - nfs_init_timeout_values(&timeparms, data->nfs_server.protocol, - data->timeo, data->retrans); - if (data->flags & NFS_MOUNT_NORESVPORT) --- a/fs/nfs/nfs4client.c +++ b/fs/nfs/nfs4client.c -@@ -849,7 +849,7 @@ static int nfs4_set_client(struct nfs_se +@@ -879,7 +879,7 @@ static int nfs4_set_client(struct nfs_se }; struct nfs_client *clp; diff --git a/patches.suse/0007-SUNRPC-Mask-XIDs-to-prevent-replay-cache-collision.patch b/patches.suse/0007-SUNRPC-Mask-XIDs-to-prevent-replay-cache-collision.patch deleted file mode 100644 index 9ab8793..0000000 --- a/patches.suse/0007-SUNRPC-Mask-XIDs-to-prevent-replay-cache-collision.patch +++ /dev/null @@ -1,122 +0,0 @@ -From: Bennett Amodio -Date: Tue, 15 Aug 2017 17:51:46 -0700 -Subject: [PATCH] SUNRPC: Mask XIDs to prevent replay cache collision -Patch-mainline: Submitted, linux-nfs@vger.kernel.org -References: fate#322786 - -Modify transport behavior so transports mask their XIDs. xid_mask is -the mask which clears the top several bits. masked_xid is the ID -(unique to each transport which belongs to the same NFS mount). - -We also removed xprt_init_xid, since the XID is now initialized -through rpc_create (and passed in via xprtargs). Since the -initialization of xid, masked_id and xid_mask occur in -xprt_create_transport, this should work with rpcrdma as well. - -Signed-off-by: Bennett Amodio -Acked-by: NeilBrown - ---- - include/linux/sunrpc/xprt.h | 5 +++++ - net/sunrpc/clnt.c | 8 ++++++++ - net/sunrpc/xprt.c | 18 +++++++++--------- - 3 files changed, 22 insertions(+), 9 deletions(-) - ---- a/include/linux/sunrpc/xprt.h -+++ b/include/linux/sunrpc/xprt.h -@@ -208,6 +208,8 @@ struct rpc_xprt { - * Multipath - */ - struct list_head xprt_switch; -+ u32 masked_id; -+ u32 xid_mask; - - /* - * Connection of transports -@@ -308,6 +310,9 @@ struct xprt_create { - struct svc_xprt *bc_xprt; /* NFSv4.1 backchannel */ - struct rpc_xprt_switch *bc_xps; - unsigned int flags; -+ u32 transport_id; -+ u32 bitmask_len; -+ u32 init_xid; - }; - - struct xprt_class { ---- a/net/sunrpc/clnt.c -+++ b/net/sunrpc/clnt.c -@@ -520,6 +520,7 @@ struct rpc_clnt *rpc_create(struct rpc_c - .addrlen = args->addrsize, - .servername = args->servername, - .bc_xprt = args->bc_xprt, -+ .init_xid = prandom_u32(), - }; - char servername[48]; - struct rpc_clnt *clnt; -@@ -572,6 +573,12 @@ struct rpc_clnt *rpc_create(struct rpc_c - xprtargs.servername = servername; - } - -+ if (args->nconnect) -+ xprtargs.bitmask_len = fls(args->nconnect - 1); -+ else -+ xprtargs.bitmask_len = 0; -+ xprtargs.transport_id = 0; -+ - xprt = xprt_create_transport(&xprtargs); - if (IS_ERR(xprt)) - return (struct rpc_clnt *)xprt; -@@ -591,6 +598,7 @@ struct rpc_clnt *rpc_create(struct rpc_c - return clnt; - - for (i = 0; i < args->nconnect - 1; i++) { -+ xprtargs.transport_id += 1; - if (rpc_clnt_add_xprt(clnt, &xprtargs, NULL, NULL) < 0) - break; - } ---- a/net/sunrpc/xprt.c -+++ b/net/sunrpc/xprt.c -@@ -1249,18 +1249,12 @@ xprt_alloc_xid(struct rpc_xprt *xprt) - __be32 xid; - - spin_lock(&xprt->reserve_lock); -- xid = (__force __be32)xprt->xid++; -+ xid = (__force __be32)(xprt->xid++ & xprt->xid_mask) | xprt->masked_id; - spin_unlock(&xprt->reserve_lock); - return xid; - } - - static void --xprt_init_xid(struct rpc_xprt *xprt) --{ -- xprt->xid = prandom_u32(); --} -- --static void - xprt_request_init(struct rpc_task *task) - { - struct rpc_xprt *xprt = task->tk_xprt; -@@ -1414,8 +1408,6 @@ static void xprt_init(struct rpc_xprt *x - rpc_init_priority_wait_queue(&xprt->sending, "xprt_sending"); - rpc_init_priority_wait_queue(&xprt->backlog, "xprt_backlog"); - -- xprt_init_xid(xprt); -- - xprt->xprt_net = get_net(net); - } - -@@ -1447,6 +1439,14 @@ found: - -PTR_ERR(xprt)); - goto out; - } -+ -+ xprt->xid_mask = 0xffffffff >> args->bitmask_len; -+ if (args->bitmask_len) -+ xprt->masked_id = args->transport_id << (32 - args->bitmask_len); -+ else -+ xprt->masked_id = 0; -+ xprt->xid = args->init_xid; -+ - if (args->flags & XPRT_CREATE_NO_IDLE_TIMEOUT) - xprt->idle_timeout = 0; - INIT_WORK(&xprt->task_cleanup, xprt_autoclose); diff --git a/patches.suse/NFS-optional-NFSv4_2-fix.patch b/patches.suse/NFS-optional-NFSv4_2-fix.patch deleted file mode 100644 index a7c0760..0000000 --- a/patches.suse/NFS-optional-NFSv4_2-fix.patch +++ /dev/null @@ -1,30 +0,0 @@ -From: NeilBrown -Subject: Don't restrict NFSv4.2 on openSUSE -Patch-mainline: Never, suse specific -References: bsc#1138719 - -We default the nfs.max_minor_version to 1 on some SLE kernels, -but don't need to do that for openSUSE - Leap or Tumbleweed - ---- - fs/nfs/super.c | 4 ++++ - 1 file changed, 4 insertions(+) - ---- a/fs/nfs/super.c -+++ b/fs/nfs/super.c -@@ -76,11 +76,15 @@ - #define NFS_DEFAULT_VERSION 2 - #endif - -+#ifdef CONFIG_SUSE_PRODUCT_SLE - #if CONFIG_SUSE_VERSION < 15 || (CONFIG_SUSE_VERSION == 15 && CONFIG_SUSE_PATCHLEVEL == 0) - static int max_minor_version = 1; - #else - static int max_minor_version = 2; - #endif -+#else -+static int max_minor_version = 2; -+#endif - - #define NFS_MAX_CONNECTIONS 16 - diff --git a/patches.suse/NFS-optional-NFSv4_2.patch b/patches.suse/NFS-optional-NFSv4_2.patch deleted file mode 100644 index 239747c..0000000 --- a/patches.suse/NFS-optional-NFSv4_2.patch +++ /dev/null @@ -1,51 +0,0 @@ -From: NeilBrown -Subject: NFS add module option to limit NFSv4 minor version. -Patch-mainline: Never, suse-specific -References: jsc#PM-231 - -We want to provide NFSv4.2 client support as opt-in. -Default mount.nfs behaviour is to mount highest version supported. -So add a module option to set highest supported option, and -reject mount attempt for higher minor. -Set default to '1' for SLE12 and SLE15.0 -Set default to '2' for SLE15-SP1 and later. - -Signed-off-by: NeilBrown - ---- - fs/nfs/super.c | 11 +++++++++++ - 1 file changed, 11 insertions(+) - ---- a/fs/nfs/super.c -+++ b/fs/nfs/super.c -@@ -76,6 +76,12 @@ - #define NFS_DEFAULT_VERSION 2 - #endif - -+#if CONFIG_SUSE_VERSION < 15 || (CONFIG_SUSE_VERSION == 15 && CONFIG_SUSE_PATCHLEVEL == 0) -+static int max_minor_version = 1; -+#else -+static int max_minor_version = 2; -+#endif -+ - #define NFS_MAX_CONNECTIONS 16 - - enum { -@@ -1425,6 +1431,8 @@ static int nfs_parse_mount_options(char - goto out_invalid_value; - if (option > NFS4_MAX_MINOR_VERSION) - goto out_invalid_value; -+ if (option > max_minor_version) -+ goto out_invalid_value; - mnt->minorversion = option; - break; - -@@ -2923,5 +2931,8 @@ MODULE_PARM_DESC(recover_lost_locks, - "If the server reports that a lock might be lost, " - "try to recover it risking data corruption."); - -+module_param(max_minor_version, int, 0644); -+MODULE_PARM_DESC(max_minor_version, -+ "Maximum NFSv4.x minor version that can be mounted"); - - #endif /* CONFIG_NFS_V4 */ diff --git a/patches.suse/d-lookup-fairness.fix b/patches.suse/d-lookup-fairness.fix deleted file mode 100644 index 72d4f15..0000000 --- a/patches.suse/d-lookup-fairness.fix +++ /dev/null @@ -1,61 +0,0 @@ -From: NeilBrown -Subject: Improve fairness when locking the per-superblock s_anon list -Patch-mainline: Not yet, will submit soon -References: bsc#957525, bsc#941363 - -bit-spin-locks, as used for dcache hash chains, are not fair. -This is not a problem for the dcache hash table as different CPUs are -likely to access different entries in the hash table so high contention -is no expected. -However anonymous dentryies (created by NFSD) all live on a single hash -chain "s_anon" and the bitlock on this can be highly contended, resulting -in soft-lockup warnings. - -So introduce a global (fair) spinlock and take it before grabing the -bitlock on s_anon. This provides fairness and makes the warnings go away. - -Having a per-superblock spinlock would be preferred, but there aren't any. - -Signed-off-by: NeilBrown - ---- - fs/dcache.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - ---- a/fs/dcache.c -+++ b/fs/dcache.c -@@ -112,6 +112,8 @@ static inline struct hlist_bl_head *d_ha - #define IN_LOOKUP_SHIFT 10 - static struct hlist_bl_head in_lookup_hashtable[1 << IN_LOOKUP_SHIFT]; - -+static DEFINE_SPINLOCK(s_anon_lock); -+ - static inline struct hlist_bl_head *in_lookup_hash(const struct dentry *parent, - unsigned int hash) - { -@@ -479,9 +481,13 @@ static void ___d_drop(struct dentry *den - else - b = d_hash(dentry->d_name.hash); - -+ if (b == &dentry->d_sb->s_anon) -+ spin_lock(&s_anon_lock); - hlist_bl_lock(b); - __hlist_bl_del(&dentry->d_hash); - hlist_bl_unlock(b); -+ if (b == &dentry->d_sb->s_anon) -+ spin_unlock(&s_anon_lock); - /* After this call, in-progress rcu-walk path lookup will fail. */ - write_seqcount_invalidate(&dentry->d_seq); - } -@@ -2000,9 +2006,11 @@ static struct dentry *__d_obtain_alias(s - spin_lock(&tmp->d_lock); - __d_set_inode_and_type(tmp, inode, add_flags); - hlist_add_head(&tmp->d_u.d_alias, &inode->i_dentry); -+ spin_lock(&s_anon_lock); - hlist_bl_lock(&tmp->d_sb->s_anon); - hlist_bl_add_head(&tmp->d_hash, &tmp->d_sb->s_anon); - hlist_bl_unlock(&tmp->d_sb->s_anon); -+ spin_unlock(&s_anon_lock); - spin_unlock(&tmp->d_lock); - spin_unlock(&inode->i_lock); - diff --git a/patches.suse/getcwd-close-race-with-d_move-called-by-lustre.patch b/patches.suse/getcwd-close-race-with-d_move-called-by-lustre.patch deleted file mode 100644 index 2b07c31..0000000 --- a/patches.suse/getcwd-close-race-with-d_move-called-by-lustre.patch +++ /dev/null @@ -1,74 +0,0 @@ -From: NeilBrown -Subject: getcwd: Close race with d_move called by lustre -Patch-mainline: Not yet, under development -References: bsc#1052593 - -When lustre invalidates a dentry (e.g. do to a recalled lock) and then -revalidates it, ll_splice_alias() will call d_move() to move the old alias -to the name of a new one. -This will d_drop then d_rehash the old dentry, creating a small window -when the dentry in unhashed. -If getcwd is run at this time, it might incorrectly think that -the dentry really is unhashed, and so return ENOENT. - -This is a bug in lustre (it shouldn't call d_move()) but we can work -around it in getcwd by taking the d_lock to avoid the race. -First we test without the lock as the common case does not involve -any race. If we find the the dentry appears to be unhashed, we take -the lock and check again. - -Signed-off-by: Neil Brown - ---- - fs/dcache.c | 19 ++++++++++++++++--- - 1 file changed, 16 insertions(+), 3 deletions(-) - ---- a/fs/dcache.c -+++ b/fs/dcache.c -@@ -3228,6 +3228,19 @@ char *d_absolute_path(const struct path - return res; - } - -+static inline bool d_unlinked_safe(struct dentry *de) -+{ -+ bool ret; -+ ret = d_unlinked(de); -+ if (unlikely(ret)) { -+ /* Maybe racing with d_move called from lustre */ -+ spin_lock(&de->d_lock); -+ ret = d_unlinked(de); -+ spin_unlock(&de->d_lock); -+ } -+ return ret; -+} -+ - /* - * same as __d_path but appends "(deleted)" for unlinked files. - */ -@@ -3236,7 +3249,7 @@ static int path_with_deleted(const struc - char **buf, int *buflen) - { - prepend(buf, buflen, "\0", 1); -- if (d_unlinked(path->dentry)) { -+ if (d_unlinked_safe(path->dentry)) { - int error = prepend(buf, buflen, " (deleted)", 10); - if (error) - return error; -@@ -3400,7 +3413,7 @@ char *dentry_path(struct dentry *dentry, - char *p = NULL; - char *retval; - -- if (d_unlinked(dentry)) { -+ if (d_unlinked_safe(dentry)) { - p = buf + buflen; - if (prepend(&p, &buflen, "//deleted", 10) != 0) - goto Elong; -@@ -3457,7 +3470,7 @@ SYSCALL_DEFINE2(getcwd, char __user *, b - get_fs_root_and_pwd_rcu(current->fs, &root, &pwd); - - error = -ENOENT; -- if (!d_unlinked(pwd.dentry)) { -+ if (!d_unlinked_safe(pwd.dentry)) { - unsigned long len; - char *cwd = page + PATH_MAX; - int buflen = PATH_MAX; diff --git a/patches.suse/nfs-set-acl-perm.patch b/patches.suse/nfs-set-acl-perm.patch index 063d62b..70a6196 100644 --- a/patches.suse/nfs-set-acl-perm.patch +++ b/patches.suse/nfs-set-acl-perm.patch @@ -22,7 +22,7 @@ Acked-by: NeilBrown --- a/fs/posix_acl.c +++ b/fs/posix_acl.c -@@ -21,6 +21,7 @@ +@@ -22,6 +22,7 @@ #include #include #include @@ -30,7 +30,7 @@ Acked-by: NeilBrown static struct posix_acl **acl_by_type(struct inode *inode, int type) { -@@ -863,8 +864,14 @@ set_posix_acl(struct inode *inode, int t +@@ -864,8 +865,14 @@ set_posix_acl(struct inode *inode, int t if (type == ACL_TYPE_DEFAULT && !S_ISDIR(inode->i_mode)) return acl ? -EACCES : 0; diff --git a/patches.suse/sunrpc-cache-handle-missing-listeners-better.patch b/patches.suse/sunrpc-cache-handle-missing-listeners-better.patch deleted file mode 100644 index 01c4224..0000000 --- a/patches.suse/sunrpc-cache-handle-missing-listeners-better.patch +++ /dev/null @@ -1,65 +0,0 @@ -From: NeilBrown -Date: Fri, 22 Mar 2019 12:23:45 +1100 -Subject: [PATCH] sunrpc/cache: handle missing listeners better. -Patch-mainline: Submitted, 22 Mar 2019 13:16:56 +1100 - linux-nfs@vger.kernel.org -References: bsc#1126221 - -If no handler (such as rpc.mountd) has opened -a cache 'channel', the sunrpc cache responds to -all lookup requests with -ENOENT. This is particularly -important for the auth.unix.gid cache which is -optional. - -If the channel was open briefly and an upcall was written to it, -this upcall remains pending even when the handler closes the -channel. When an upcall is pending, the code currently -doesn't check if there are still listeners, it only performs -that check before sending an upcall. - -As the cache treads a recently closes channel (closed less than -30 seconds ago) as "potentially still open", there is a -reasonable sized window when a request can become pending -in a closed channel, and thereby block lookups indefinitely. - -This can easily be demonstrated by running - cat /proc/net/rpc/auth.unix.gid/channel - -and then trying to mount an NFS filesystem from this host. It -will block indefinitely (unless mountd is run with --manage-gids, -or krb5 is used). - -When cache_check() finds that an upcall is pending, it should -perform the "cache_listeners_exist()" exist test. If no -listeners do exist, the request should be negated. - -With this change in place, there can still be a 30second wait on -mount, until the cache gives up waiting for a handler to come -back, but this is much better than an indefinite wait. - -Signed-off-by: NeilBrown -Acked-by: NeilBrown - ---- - net/sunrpc/cache.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - ---- a/net/sunrpc/cache.c -+++ b/net/sunrpc/cache.c -@@ -40,6 +40,7 @@ - - static bool cache_defer_req(struct cache_req *req, struct cache_head *item); - static void cache_revisit_request(struct cache_head *item); -+static bool cache_listeners_exist(struct cache_detail *detail); - - static void cache_init(struct cache_head *h, struct cache_detail *detail) - { -@@ -279,7 +280,8 @@ int cache_check(struct cache_detail *det - cache_fresh_unlocked(h, detail); - break; - } -- } -+ } else if (!cache_listeners_exist(detail)) -+ rv = try_to_negate_entry(detail, h); - } - - if (rv == -EAGAIN) { diff --git a/patches.suse/vfs-use-synchronize_rcu_expedited-in-namespace_unlock.patch b/patches.suse/vfs-use-synchronize_rcu_expedited-in-namespace_unlock.patch deleted file mode 100644 index 83cd60a..0000000 --- a/patches.suse/vfs-use-synchronize_rcu_expedited-in-namespace_unlock.patch +++ /dev/null @@ -1,47 +0,0 @@ -From: NeilBrown -Subject: VFS: use synchronize_rcu_expedited() in namespace_unlock() -References: bsc#1024412 -Patch-mainline: submitted, https://patchwork.kernel.org/patch/10027405/ - -The synchronize_rcu() in namespace_unlock() is called every time -a filesystem is unmounted. If a great many filesystems are mounted, -this can cause a noticable slow-down in, for example, system shutdown. - -The sequence: - mkdir -p /tmp/Mtest/{0..5000} - time for i in /tmp/Mtest/*; do mount -t tmpfs tmpfs $i ; done - time umount /tmp/Mtest/* - -on a 4-cpu VM can report 8 seconds to mount the tmpfs filesystems, and -100 seconds to unmount them. - -Boot the same VM with 1 CPU and it takes 18 seconds to mount the -tmpfs filesystems, but only 36 to unmount. - -If we change the synchronize_rcu() to synchronize_rcu_expedited() -the umount time on a 4-cpu VM is 8 seconds to mount and 0.6 to -unmount. - -I think this 200-fold speed up is worth the slightly higher system -impact of use synchronize_rcu_expedited(). - -Signed-off-by: NeilBrown -Acked-by: NeilBrown - -(Paul McKenney acked the patch, Al Viro hasn't responded yet). - ---- - fs/namespace.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/fs/namespace.c -+++ b/fs/namespace.c -@@ -1370,7 +1370,7 @@ static void namespace_unlock(void) - if (likely(hlist_empty(&head))) - return; - -- synchronize_rcu(); -+ synchronize_rcu_expedited(); - - group_pin_kill(&head); - } diff --git a/series.conf b/series.conf index 6889571..4db2a30 100644 --- a/series.conf +++ b/series.conf @@ -180,6 +180,12 @@ # XFS patches.suse/xfs-remove-experimental-tag-for-dax-support.patch + # NFS + patches.suse/0001-NFS-flush-out-dirty-data-on-file-fput.patch + patches.suse/0001-NFSv4-don-t-let-hanging-mounts-block-other-mounts.patch + patches.suse/0006-NFS-Allow-multiple-connections-to-NFSv3-and-NFSv4.0-.patch + patches.suse/nfs-set-acl-perm.patch + # other patches.suse/pstore_disable_efi_backend_by_default.patch @@ -518,25 +524,6 @@ +nborisov patches.suse/0005-btrfs-Handle-one-more-split-brain-scenario-during-fs.patch +nborisov patches.suse/0006-btrfs-Handle-final-split-brain-possibility-during-fs.patch +nborisov patches.suse/btrfs-add-sysfs-support-for-metadata_uuid-feature.patch -# neilb -+neilb patches.suse/0001-NFS-flush-out-dirty-data-on-file-fput.patch -+neilb patches.suse/0001-NFSv4-don-t-let-hanging-mounts-block-other-mounts.patch -+neilb patches.suse/0001-NFSv4-handle-EINVAL-from-EXCHANGE_ID-better.patch -+neilb patches.suse/0001-SUNRPC-Allow-creation-of-RPC-clients-with-multiple-c.patch -+neilb patches.suse/0001-sunrpc-include-sup-groups-in-hash.patch -+neilb patches.suse/0002-NFS-Add-a-mount-option-to-specify-number-of-TCP-conn.patch -+neilb patches.suse/0003-NFSv4-Allow-multiple-connections-to-NFSv4.x-x-0-serv.patch -+neilb patches.suse/0004-pNFS-Allow-multiple-connections-to-the-DS.patch -+neilb patches.suse/0005-NFS-Display-the-nconnect-mount-option-if-it-is-set.patch -+neilb patches.suse/0006-NFS-Allow-multiple-connections-to-NFSv3-and-NFSv4.0-.patch -+neilb patches.suse/0007-SUNRPC-Mask-XIDs-to-prevent-replay-cache-collision.patch -+neilb patches.suse/d-lookup-fairness.fix -+neilb patches.suse/getcwd-close-race-with-d_move-called-by-lustre.patch -+neilb patches.suse/nfs-set-acl-perm.patch -+neilb patches.suse/sunrpc-cache-handle-missing-listeners-better.patch -+neilb patches.suse/vfs-use-synchronize_rcu_expedited-in-namespace_unlock.patch -+neilb patches.suse/NFS-optional-NFSv4_2-fix.patch -+neilb patches.suse/NFS-optional-NFSv4_2.patch # nsaenzjulienne +nsaenzjulienne patches.suse/firmware-arm_sdei-fix-wrong-of_node_put-in-init-function.patch # palcantara