diff options
author | Miklos Szeredi <mszeredi@redhat.com> | 2024-02-28 16:50:49 +0100 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2024-03-05 13:40:43 +0100 |
commit | b1fe686a765e6c0d71811d825b5a1585a202b777 (patch) | |
tree | ba7fa8269beb3a7cd4085e64187eada7fb91c372 /fs/fuse/inode.c | |
parent | 68ca1b49e430f6534d0774a94147a823e3b8b26e (diff) |
fuse: don't unhash root
The root inode is assumed to be always hashed. Do not unhash the root
inode even if it is marked BAD.
Fixes: 5d069dbe8aaf ("fuse: fix bad inode")
Cc: <stable@vger.kernel.org> # v5.11
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse/inode.c')
-rw-r--r-- | fs/fuse/inode.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 0186df5fc9ea..065b84efb663 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -475,8 +475,11 @@ retry: } else if (fuse_stale_inode(inode, generation, attr)) { /* nodeid was reused, any I/O on the old inode should fail */ fuse_make_bad(inode); - iput(inode); - goto retry; + if (inode != d_inode(sb->s_root)) { + remove_inode_hash(inode); + iput(inode); + goto retry; + } } fi = get_fuse_inode(inode); spin_lock(&fi->lock); |