Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F131791494
D15424.id42616.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D15424.id42616.diff
View Options
Index: sys/fs/nfsserver/nfs_nfsdport.c
===================================================================
--- sys/fs/nfsserver/nfs_nfsdport.c
+++ sys/fs/nfsserver/nfs_nfsdport.c
@@ -2169,10 +2169,22 @@
}
}
}
- if (!r) {
- if (refp == NULL &&
- ((nd->nd_flag & ND_NFSV3) ||
- NFSNONZERO_ATTRBIT(&attrbits))) {
+
+ /*
+ * If we failed to look up the entry, then it
+ * has become invalid, most likely removed.
+ */
+ if (r != 0) {
+ if (needs_unbusy)
+ vfs_unbusy(new_mp);
+ goto invalid;
+ }
+ KASSERT(refp != NULL || nvp != NULL,
+ ("%s: undetected lookup error", __func__));
+
+ if (refp == NULL &&
+ ((nd->nd_flag & ND_NFSV3) ||
+ NFSNONZERO_ATTRBIT(&attrbits))) {
r = nfsvno_getfh(nvp, &nfh, p);
if (!r)
r = nfsvno_getattr(nvp, nvap,
@@ -2193,17 +2205,25 @@
if (new_mp == mp)
new_mp = nvp->v_mount;
}
- }
- } else {
- nvp = NULL;
}
- if (r) {
+
+ /*
+ * If we failed to get attributes of the entry,
+ * then just skip it for NFSv3 (the traditional
+ * behavior in the old NFS server).
+ * For NFSv4 the behavior is controlled by
+ * RDATTRERROR: we either ignore the error or
+ * fail the request.
+ * Note that RDATTRERROR is never set for NFSv3.
+ */
+ if (r != 0) {
if (!NFSISSET_ATTRBIT(&attrbits,
NFSATTRBIT_RDATTRERROR)) {
- if (nvp != NULL)
- vput(nvp);
+ vput(nvp);
if (needs_unbusy != 0)
vfs_unbusy(new_mp);
+ if ((nd->nd_flag & ND_NFSV3))
+ goto invalid;
nd->nd_repstat = r;
break;
}
@@ -2272,6 +2292,7 @@
if (dirlen <= cnt)
entrycnt++;
}
+invalid:
cpos += dp->d_reclen;
dp = (struct dirent *)cpos;
cookiep++;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Oct 12, 4:57 AM (5 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
23609320
Default Alt Text
D15424.id42616.diff (1 KB)
Attached To
Mode
D15424: nfsrvd_readdirplus: for some errors, skip an entry instead of failing the request
Attached
Detach File
Event Timeline
Log In to Comment