Blob Blame History Raw
From: NeilBrown <neilb@suse.com>
Subject: NFSv4.x: always serialize open/close operations.
References: bsc#1114893
Patch-mainline: never, a better fix is needed

NFSv4.1 and later allow open, open_downgrade, and close operations
on a given file to occur in parallel and provides a way for the server
to unambiguously indicate which operation was processed last.

Unfortuantely, the results in a number of races which are not correctly handled
by the Linux client code.  Some have been fixed since 4.4, others
have not.

The easiest way to ensure correct behaviour is to revert to the
NFSv4.0 practice of serializing these operations.

In 4.12 (for SLE12-SP4) we shouldn't need this patch as those races in
the client code have been fixed.
However there seems to be a NetApp server bug which is avoided by
this patch.  So the customer experience is that NFSv4.1 works to the
Netapp in SLE12-SP3, but not in SLE12-SP4.  We don't want them to have
that experience.  So it is being added to SP4 too.
It will not be added to SLE15 - the same justification doesn't hold.

Signed-off-by: NeilBrown <neilb@suse.com>
Acked-by: NeilBrown <neilb@suse.com>

---
 fs/nfs/nfs4proc.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -9301,11 +9301,6 @@ static const struct nfs4_minor_version_o
 };
 
 #if defined(CONFIG_NFS_V4_1)
-static struct nfs_seqid *
-nfs_alloc_no_seqid(struct nfs_seqid_counter *arg1, gfp_t arg2)
-{
-	return NULL;
-}
 
 static const struct nfs4_minor_version_ops nfs_v4_1_minor_ops = {
 	.minor_version = 1,
@@ -9320,7 +9315,7 @@ static const struct nfs4_minor_version_o
 	.find_root_sec = nfs41_find_root_sec,
 	.free_lock_state = nfs41_free_lock_state,
 	.test_and_free_expired = nfs41_test_and_free_expired_stateid,
-	.alloc_seqid = nfs_alloc_no_seqid,
+	.alloc_seqid = nfs_alloc_seqid,
 	.session_trunk = nfs4_test_session_trunk,
 	.call_sync_ops = &nfs41_call_sync_ops,
 	.reboot_recovery_ops = &nfs41_reboot_recovery_ops,
@@ -9351,7 +9346,7 @@ static const struct nfs4_minor_version_o
 	.free_lock_state = nfs41_free_lock_state,
 	.call_sync_ops = &nfs41_call_sync_ops,
 	.test_and_free_expired = nfs41_test_and_free_expired_stateid,
-	.alloc_seqid = nfs_alloc_no_seqid,
+	.alloc_seqid = nfs_alloc_seqid,
 	.session_trunk = nfs4_test_session_trunk,
 	.reboot_recovery_ops = &nfs41_reboot_recovery_ops,
 	.nograce_recovery_ops = &nfs41_nograce_recovery_ops,