freebsd-dev/tests/sys/fs
Alan Somers 25927e068f fusefs: correctly handle an inode that changes file types
Correctly handle the situation where a FUSE server unlinks a file, then
creates a new file of a different type but with the same inode number.
Previously fuse_vnop_lookup in this situation would return EAGAIN.  But
since it didn't call vgone(), the vnode couldn't be reused right away.
Fix this by immediately calling vgone() and reallocating a new vnode.

This problem can occur in three code paths, during VOP_LOOKUP,
VOP_SETATTR, or following FUSE_GETATTR, which usually happens during
VOP_GETATTR but can occur during other vops, too.  Note that the correct
response actually doesn't depend on whether the entry cache has expired.
In fact, during VOP_LOOKUP, we can't even tell.  Either it has expired
already, or else the vnode got reclaimed by vnlru.

Also, correct the error code during the VOP_SETATTR path.

PR:		258022
Reported by:	chogata@moosefs.pro
MFC after:	2 weeks
Reviewed by:	pfg
Differential Revision: https://reviews.freebsd.org/D33283
2021-12-06 21:36:46 -07:00
..
fusefs fusefs: correctly handle an inode that changes file types 2021-12-06 21:36:46 -07:00
tmpfs Fix sys.fs.tmpfs.mknod_test.{char, block} by reverting r321967 2018-07-21 20:14:01 +00:00
Makefile Refine fusefs test workaround for mips+llvm 2020-01-06 18:25:58 +00:00
Makefile.depend DIRDEPS_BUILD: Connect new directories. 2017-10-31 00:04:07 +00:00
Makefile.inc