aboutsummaryrefslogtreecommitdiff
path: root/sys/fs/nfsclient
diff options
context:
space:
mode:
authorRick Macklem <rmacklem@FreeBSD.org>2023-10-22 01:33:33 +0000
committerRick Macklem <rmacklem@FreeBSD.org>2023-10-22 01:33:33 +0000
commit14bbf4fe5abb20f1126168e66b03127ae920f78e (patch)
tree2486231f5ba139c0b7409550dc079549d792f63c /sys/fs/nfsclient
parent2fee3974603bce6f2dc153eb6af459cb4f864ab4 (diff)
downloadsrc-14bbf4fe5abb20f1126168e66b03127ae920f78e.tar.gz
src-14bbf4fe5abb20f1126168e66b03127ae920f78e.zip
Diffstat (limited to 'sys/fs/nfsclient')
-rw-r--r--sys/fs/nfsclient/nfs_clrpcops.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c
index 2276e09f6e7e..87362f2e744f 100644
--- a/sys/fs/nfsclient/nfs_clrpcops.c
+++ b/sys/fs/nfsclient/nfs_clrpcops.c
@@ -609,7 +609,8 @@ nfsrpc_openrpc(struct nfsmount *nmp, vnode_t vp, u_int8_t *nfhp, int fhlen,
if (error)
return (error);
NFSCL_INCRSEQID(op->nfso_own->nfsow_seqid, nd);
- if (!nd->nd_repstat) {
+ if (nd->nd_repstat == 0 || (nd->nd_repstat == NFSERR_DELAY &&
+ reclaim != 0 && (nd->nd_flag & ND_NOMOREDATA) == 0)) {
NFSM_DISSECT(tl, u_int32_t *, NFSX_STATEID +
6 * NFSX_UNSIGNED);
op->nfso_stateid.seqid = *tl++;
@@ -681,16 +682,29 @@ nfsrpc_openrpc(struct nfsmount *nmp, vnode_t vp, u_int8_t *nfhp, int fhlen,
goto nfsmout;
}
NFSM_DISSECT(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
- error = nfsv4_loadattr(nd, NULL, &nfsva, NULL,
- NULL, 0, NULL, NULL, NULL, NULL, NULL, 0,
- NULL, NULL, NULL, p, cred);
- if (error)
- goto nfsmout;
+ /* If the 2nd element == NFS_OK, the Getattr succeeded. */
+ if (*++tl == 0) {
+ KASSERT(nd->nd_repstat == 0,
+ ("nfsrpc_openrpc: Getattr repstat"));
+ error = nfsv4_loadattr(nd, NULL, &nfsva, NULL,
+ NULL, 0, NULL, NULL, NULL, NULL, NULL, 0,
+ NULL, NULL, NULL, p, cred);
+ if (error)
+ goto nfsmout;
+ }
if (ndp != NULL) {
- ndp->nfsdl_change = nfsva.na_filerev;
- ndp->nfsdl_modtime = nfsva.na_mtime;
- ndp->nfsdl_flags |= NFSCLDL_MODTIMESET;
+ if (reclaim != 0 && dp != NULL) {
+ ndp->nfsdl_change = dp->nfsdl_change;
+ ndp->nfsdl_modtime = dp->nfsdl_modtime;
+ ndp->nfsdl_flags |= NFSCLDL_MODTIMESET;
+ } else if (nd->nd_repstat == 0) {
+ ndp->nfsdl_change = nfsva.na_filerev;
+ ndp->nfsdl_modtime = nfsva.na_mtime;
+ ndp->nfsdl_flags |= NFSCLDL_MODTIMESET;
+ } else
+ ndp->nfsdl_flags |= NFSCLDL_RECALL;
}
+ nd->nd_repstat = 0;
if (!reclaim && (rflags & NFSV4OPEN_RESULTCONFIRM)) {
do {
ret = nfsrpc_openconfirm(vp, newfhp, newfhlen, op,