diff options
author | rmacklem <rmacklem@FreeBSD.org> | 2017-07-16 19:36:44 +0000 |
---|---|---|
committer | rmacklem <rmacklem@FreeBSD.org> | 2017-07-16 19:36:44 +0000 |
commit | a9ad15f3911f8b27134fa4315021904ca81a7e04 (patch) | |
tree | b1dd2cf46ae4f104d8df4c9ab2e73838de67f2ee | |
parent | e07100506434312a3c9ae945e3ff6df5a1046fea (diff) | |
download | FreeBSD-src-a9ad15f3911f8b27134fa4315021904ca81a7e04.zip FreeBSD-src-a9ad15f3911f8b27134fa4315021904ca81a7e04.tar.gz |
MFC: r320458
Fix an NFSv3 client case that probably never happens.
If an NFSv3 server were to reply with weak cache consistency attributes,
but not post operation attributes, the client would use garbage attributes
from memory. This was spotted during work on the code for the NFSv4.1 client.
I have never seen evidence that this happens and it wouldn't make sense
for an NFSv3 server to do this, so this patch is basically "theoretical",
but does fix the problem if a server were to do the above.
-rw-r--r-- | sys/fs/nfsclient/nfs_clport.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/fs/nfsclient/nfs_clport.c b/sys/fs/nfsclient/nfs_clport.c index c1830c0..46b1efb 100644 --- a/sys/fs/nfsclient/nfs_clport.c +++ b/sys/fs/nfsclient/nfs_clport.c @@ -666,6 +666,8 @@ nfscl_wcc_data(struct nfsrv_descript *nd, struct vnode *vp, } } error = nfscl_postop_attr(nd, nap, flagp, stuff); + if (wccflagp != NULL && *flagp == 0) + *wccflagp = 0; } else if ((nd->nd_flag & (ND_NOMOREDATA | ND_NFSV4 | ND_V4WCCATTR)) == (ND_NFSV4 | ND_V4WCCATTR)) { error = nfsv4_loadattr(nd, NULL, &nfsva, NULL, |