diff options
author | Rick Macklem <rmacklem@FreeBSD.org> | 2022-03-13 20:15:12 +0000 |
---|---|---|
committer | Rick Macklem <rmacklem@FreeBSD.org> | 2022-03-13 20:15:12 +0000 |
commit | 57014f21e754db70e4811f9d064303cd8608f164 (patch) | |
tree | 2d521936e39da1856b442c3ca9ecd6ab2be3d6f9 /sys/fs/nfsclient | |
parent | 19a6267d61a0c3bd6cd56f19ca3f8a67a54f675c (diff) | |
download | src-57014f21e754db70e4811f9d064303cd8608f164.tar.gz src-57014f21e754db70e4811f9d064303cd8608f164.zip |
nfscl: Fix NFSv4.1/4.2 Lookup+Open RPC
Use of the Lookup+Open RPC is currently disabled,
due to a problem detected during testing. This
patch fixes this problem. The problem was that
nfscl_postop_attr() does not parse the attributes
if nd_repstat != 0. It also would parse the
return status for the operation, where the
Lookup+Open code had already parsed it.
The first change in the patch does not make any
semantics change, but makes the code identical
to what is done later in the function, so that
it is apparent that the semantics should be the
same in both places.
Lookup+Open remains disabled while further
testing is being done, so this patch has no
effect at this time.
Diffstat (limited to 'sys/fs/nfsclient')
-rw-r--r-- | sys/fs/nfsclient/nfs_clrpcops.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 8886ccc8429e..cc4899af1c90 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -1499,10 +1499,9 @@ nfsrpc_lookup(vnode_t dvp, char *name, int len, struct ucred *cred, ND_NFSV4) { /* Load the directory attributes. */ error = nfsm_loadattr(nd, dnap); - if (error == 0) - *dattrflagp = 1; - else + if (error != 0) goto nfsmout; + *dattrflagp = 1; } /* Check Lookup operation reply status. */ if (openmode != 0 && (nd->nd_flag & ND_NOMOREDATA) == 0) { @@ -1524,10 +1523,15 @@ nfsrpc_lookup(vnode_t dvp, char *name, int len, struct ucred *cred, NFSM_DISSECT(tl, uint32_t *, 2 * NFSX_UNSIGNED); if (*++tl != 0) goto nfsmout; - error = nfscl_postop_attr(nd, nap, attrflagp, stuff); - if (error == 0) - /* Successfully got Lookup done. */ + error = nfsm_loadattr(nd, nap); + if (error == 0) { + /* + * We have now successfully completed the + * lookup, so set nd_repstat to 0. + */ nd->nd_repstat = 0; + *attrflagp = 1; + } } goto nfsmout; } |