]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
fusefs: fix two bugs regarding VOP_RECLAIM of the root inode
authorAlan Somers <asomers@FreeBSD.org>
Sat, 2 Apr 2022 19:31:24 +0000 (13:31 -0600)
committerAlan Somers <asomers@FreeBSD.org>
Fri, 29 Apr 2022 17:16:00 +0000 (11:16 -0600)
commit507b75ced9fd9f0477e3f5ce1a80b14b2ba26c31
tree06ff164d2947ee245ea28d22ff5885ff72b62b1b
parent7eb963109563e4b3bda3ad8196fe4a3896ffac69
fusefs: fix two bugs regarding VOP_RECLAIM of the root inode

* We never send FUSE_LOOKUP for the root inode, since its inode number
  is hard-coded to 1.  Therefore, we should not send FUSE_FORGET for it,
  lest the server see its lookup count fall below 0.

* During VOP_RECLAIM, if we are reclaiming the root inode, we must clear
  the file system's vroot pointer.  Otherwise it will be left pointing
  at a reclaimed vnode, which will cause future VOP_LOOKUP operations to
  fail.  Previously we only cleared that pointer during VFS_UMOUNT.  I
  don't know of any real-world way to trigger this bug.

Reviewed by: pfg
Differential Revision: https://reviews.freebsd.org/D34753

(cherry picked from commit 32273253667b941c376cf08383006b3a0cbc5ca2)
sys/fs/fuse/fuse_vnops.c
tests/sys/fs/fusefs/destroy.cc
tests/sys/fs/fusefs/dev_fuse_poll.cc
tests/sys/fs/fusefs/forget.cc
tests/sys/fs/fusefs/lookup.cc