[Devel] [PATCH RHEL8 COMMIT] ms/fuse: fix live lock in fuse_iget()

Konstantin Khorenko khorenko at virtuozzo.com
Fri Apr 30 11:41:39 MSK 2021


The commit is pushed to "branch-rh8-4.18.0-240.1.1.vz8.5.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-240.1.1.vz8.5.23
------>
commit e3d3d3acc0b2949a4ef4c554fe14854da7fad8d2
Author: Amir Goldstein <amir73il at gmail.com>
Date:   Thu Mar 4 11:09:12 2021 +0200

    ms/fuse: fix live lock in fuse_iget()
    
    Commit 5d069dbe8aaf ("fuse: fix bad inode") replaced make_bad_inode()
    in fuse_iget() with a private implementation fuse_make_bad().
    
    The private implementation fails to remove the bad inode from inode
    cache, so the retry loop with iget5_locked() finds the same bad inode
    and marks it bad forever.
    
    kmsg snip:
    
    [ ] rcu: INFO: rcu_sched self-detected stall on CPU
    ...
    [ ]  ? bit_wait_io+0x50/0x50
    [ ]  ? fuse_init_file_inode+0x70/0x70
    [ ]  ? find_inode.isra.32+0x60/0xb0
    [ ]  ? fuse_init_file_inode+0x70/0x70
    [ ]  ilookup5_nowait+0x65/0x90
    [ ]  ? fuse_init_file_inode+0x70/0x70
    [ ]  ilookup5.part.36+0x2e/0x80
    [ ]  ? fuse_init_file_inode+0x70/0x70
    [ ]  ? fuse_inode_eq+0x20/0x20
    [ ]  iget5_locked+0x21/0x80
    [ ]  ? fuse_inode_eq+0x20/0x20
    [ ]  fuse_iget+0x96/0x1b0
    
    Fixes: 5d069dbe8aaf ("fuse: fix bad inode")
    Cc: stable at vger.kernel.org # 5.10+
    Signed-off-by: Amir Goldstein <amir73il at gmail.com>
    Signed-off-by: Miklos Szeredi <mszeredi at redhat.com>
    
    https://jira.sw.ru/browse/PSBM-123526
    
    (cherry picked from commit 775c5033a0d164622d9d10dd0f0a5531639ed3ed)
    Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 fs/fuse/fuse_i.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
index 99d871dc641b..f17f84d662b8 100644
--- a/fs/fuse/fuse_i.h
+++ b/fs/fuse/fuse_i.h
@@ -944,6 +944,7 @@ static inline u64 fuse_get_attr_version(struct fuse_conn *fc)
 
 static inline void fuse_make_bad(struct inode *inode)
 {
+	remove_inode_hash(inode);
 	set_bit(FUSE_I_BAD, &get_fuse_inode(inode)->state);
 }
 


More information about the Devel mailing list