Skip to contentSkip to conversation

Patch "NFSv4.1: Work around a Linux server bug..." has been added to the 4.4-stable tree

PATCH [email protected] 1 participant 1 message Apr 10, 2018

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

NFSv4.1: Work around a Linux server bug...

to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
nfsv4.1-work-around-a-linux-server-bug.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Tue Apr 10 10:31:53 CEST 2018

From: Trond Myklebust <[email protected]>
Date: Tue, 9 May 2017 15:47:15 -0400
Subject: NFSv4.1: Work around a Linux server bug...

From: Trond Myklebust <[email protected]>

[ Upstream commit f4b23de3dda1536590787c9e5c3d16b8738ab108 ]

It turns out the Linux server has a bug in its implementation of supattr_exclcreat; it returns the set of all attributes, whether or not they are supported by minor version 1.
In order to avoid a regression, we therefore apply the supported_attrs as a mask on top of whatever the server sent us.

---
 fs/nfs/nfs4proc.c |    6 ++++++
 1 file changed, 6 insertions(+)
fs/nfs/nfs4proc.c +6 -0
@@ -3025,6 +3025,7 @@ static int _nfs4_server_capabilities(str
 		.rpc_resp = &res,
 	};
 	int status;
+	int i;
 
 	bitmask[0] = FATTR4_WORD0_SUPPORTED_ATTRS |
 		     FATTR4_WORD0_FH_EXPIRE_TYPE |
@@ -3090,8 +3091,13 @@ static int _nfs4_server_capabilities(str
 		server->cache_consistency_bitmask[0] &= FATTR4_WORD0_CHANGE|FATTR4_WORD0_SIZE;
 		server->cache_consistency_bitmask[1] &= FATTR4_WORD1_TIME_METADATA|FATTR4_WORD1_TIME_MODIFY;
 		server->cache_consistency_bitmask[2] = 0;
+
+		/* Avoid a regression due to buggy server */
+		for (i = 0; i < ARRAY_SIZE(res.exclcreat_bitmask); i++)
+			res.exclcreat_bitmask[i] &= res.attr_bitmask[i];
 		memcpy(server->exclcreat_bitmask, res.exclcreat_bitmask,
 			sizeof(server->exclcreat_bitmask));
+
 		server->acl_bitmask = res.acl_bitmask;
 		server->fh_expire_type = res.fh_expire_type;
 	}

Patches currently in stable-queue which might be from [email protected] are

queue-4.4/pnfs-flexfiles-missing-error-code-in-ff_layout_alloc_lseg.patch queue-4.4/nfsv4.1-work-around-a-linux-server-bug.patch queue-4.4/sunrpc-ensure-correct-error-is-reported-by-xs_tcp_setup_socket.patch queue-4.4/nfsv4.1-reclaim_complete-must-handle-nfs4err_conn_not_bound_to_session.patch