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.
This commit is contained in:
Rick Macklem 2022-03-13 13:15:12 -07:00
parent 19a6267d61
commit 57014f21e7

View file

@ -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;
}