aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2026-07-01 01:14:45 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2026-07-03 00:28:23 +0000
commitc041b82c59e885d106f45454302bad3d9dcc58a7 (patch)
tree166246da8c2e4f9b3226f1fe20d8ab17e2994e83
parentd1b62492f97f5044b498fa4624e3a007a43efa6f (diff)
ffs: do not return ESTALE on attempt to ffs_unotovp() on unlinked inode
The consequences are: - for nfs exports and fhopen(2), unlinked but still referenced inodes are accessible - for ffs_vput_pair() with unlock_vp = false, spurious ESTALE is not returned when the inode is still alive but unlinked Note that tmpfs does not return ESTALE for the unlinked nodes. The same behavior is claimed for Linux in https://github.com/openzfs/zfs/issues/18699 Reviewed by: rmacklem Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57982
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 11afa99bea76..a9b04bd290bd 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -1962,7 +1962,7 @@ ffs_inotovp(struct mount *mp,
return (ESTALE);
ip = VTOI(nvp);
- if (ip->i_mode == 0 || ip->i_gen != gen || ip->i_effnlink <= 0) {
+ if (ip->i_mode == 0 || ip->i_gen != gen) {
if (ip->i_mode == 0)
vgone(nvp);
vput(nvp);