--- fs/fuse/dir.c | 2 +- fs/fuse/fuse_i.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -1210,7 +1210,7 @@ static int fuse_do_statx(struct inode *i if (((sx->mask & STATX_SIZE) && !fuse_valid_size(sx->size)) || ((sx->mask & STATX_TYPE) && (!fuse_valid_type(sx->mode) || inode_wrong_type(inode, sx->mode)))) { - make_bad_inode(inode); + fuse_make_bad(inode); return -EIO; } --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -939,7 +939,8 @@ static inline bool fuse_stale_inode(cons static inline void fuse_make_bad(struct inode *inode) { - remove_inode_hash(inode); + if (get_fuse_inode(inode)->nodeid != FUSE_ROOT_ID) + remove_inode_hash(inode); set_bit(FUSE_I_BAD, &get_fuse_inode(inode)->state); }