]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
fusefs: fix .. lookups when the parent has been reclaimed.
authorAlan Somers <asomers@FreeBSD.org>
Thu, 2 Dec 2021 02:50:47 +0000 (19:50 -0700)
committerAlan Somers <asomers@FreeBSD.org>
Sat, 1 Jan 2022 03:38:27 +0000 (20:38 -0700)
commit1613087a8127122b03a3730046d051adf4edd14f
treedeb00bce4ed4ecf5da982069780b4a5427a27898
parent8d99a6b91b788b7ddf88f975f288f7c6479f4be3
fusefs: fix .. lookups when the parent has been reclaimed.

By default, FUSE file systems are assumed not to support lookups for "."
and "..".  They must opt-in to that.  To cope with this limitation, the
fusefs kernel module caches every fuse vnode's parent's inode number,
and uses that during VOP_LOOKUP for "..".  But if the parent's vnode has
been reclaimed that won't be possible.  Previously we paniced in this
situation.  Now, we'll return ESTALE instead.  Or, if the file system
has opted into ".." lookups, we'll just do that instead.

This commit also fixes VOP_LOOKUP to respect the cache timeout for ".."
lookups, if the FUSE file system specified a finite timeout.

PR: 259974
MFC after: 2 weeks
Reviewed by: pfg
Differential Revision: https://reviews.freebsd.org/D33239
sys/fs/fuse/fuse_vnops.c
tests/sys/fs/fusefs/lookup.cc