aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2017-05-09 15:47:15 -0400
committerTrond Myklebust <trond.myklebust@primarydata.com>2017-05-09 15:52:15 -0400
commitf4b23de3dda1536590787c9e5c3d16b8738ab108 (patch)
tree88f2667df7691ca6298f74b1976182b48053b105
parente092693443b995c8e3a565a73b5fdb05f1260f9b (diff)
NFSv4.1: Work around a Linux server bug...
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. Reported-by: Anna Schumaker <Anna.Schumaker@Netapp.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
-rw-r--r--fs/nfs/nfs4proc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index f48dfb7f3691..c08c46a3b8cd 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3268,6 +3268,7 @@ static int _nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *f
3268 .rpc_resp = &res, 3268 .rpc_resp = &res,
3269 }; 3269 };
3270 int status; 3270 int status;
3271 int i;
3271 3272
3272 bitmask[0] = FATTR4_WORD0_SUPPORTED_ATTRS | 3273 bitmask[0] = FATTR4_WORD0_SUPPORTED_ATTRS |
3273 FATTR4_WORD0_FH_EXPIRE_TYPE | 3274 FATTR4_WORD0_FH_EXPIRE_TYPE |
@@ -3333,8 +3334,13 @@ static int _nfs4_server_capabilities(struct nfs_server *server, struct nfs_fh *f
3333 server->cache_consistency_bitmask[0] &= FATTR4_WORD0_CHANGE|FATTR4_WORD0_SIZE; 3334 server->cache_consistency_bitmask[0] &= FATTR4_WORD0_CHANGE|FATTR4_WORD0_SIZE;
3334 server->cache_consistency_bitmask[1] &= FATTR4_WORD1_TIME_METADATA|FATTR4_WORD1_TIME_MODIFY; 3335 server->cache_consistency_bitmask[1] &= FATTR4_WORD1_TIME_METADATA|FATTR4_WORD1_TIME_MODIFY;
3335 server->cache_consistency_bitmask[2] = 0; 3336 server->cache_consistency_bitmask[2] = 0;
3337
3338 /* Avoid a regression due to buggy server */
3339 for (i = 0; i < ARRAY_SIZE(res.exclcreat_bitmask); i++)
3340 res.exclcreat_bitmask[i] &= res.attr_bitmask[i];
3336 memcpy(server->exclcreat_bitmask, res.exclcreat_bitmask, 3341 memcpy(server->exclcreat_bitmask, res.exclcreat_bitmask,
3337 sizeof(server->exclcreat_bitmask)); 3342 sizeof(server->exclcreat_bitmask));
3343
3338 server->acl_bitmask = res.acl_bitmask; 3344 server->acl_bitmask = res.acl_bitmask;
3339 server->fh_expire_type = res.fh_expire_type; 3345 server->fh_expire_type = res.fh_expire_type;
3340 } 3346 }