* [PATCH] fuse: fix live lock in fuse_iget()
@ 2021-03-04 9:09 Amir Goldstein
2021-03-04 12:37 ` Miklos Szeredi
0 siblings, 1 reply; 2+ messages in thread
From: Amir Goldstein @ 2021-03-04 9:09 UTC (permalink / raw)
To: Miklos Szeredi; +Cc: Jan Kara, linux-fsdevel, stable
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@vger.kernel.org # 5.10+
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---
Miklos,
This live lock showed up on a stress test in my system after upgarde to
kernel 5.10. It's 100% reproducible when trying to rsync from a davfs2
filesystem with severel 1000 files.
Thanks,
Amir.
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 68cca8d4db6e..63d97a15ffde 100644
--- a/fs/fuse/fuse_i.h
+++ b/fs/fuse/fuse_i.h
@@ -863,6 +863,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);
}
--
2.30.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] fuse: fix live lock in fuse_iget()
2021-03-04 9:09 [PATCH] fuse: fix live lock in fuse_iget() Amir Goldstein
@ 2021-03-04 12:37 ` Miklos Szeredi
0 siblings, 0 replies; 2+ messages in thread
From: Miklos Szeredi @ 2021-03-04 12:37 UTC (permalink / raw)
To: Amir Goldstein; +Cc: Jan Kara, linux-fsdevel, stable
On Thu, Mar 4, 2021 at 10:09 AM Amir Goldstein <amir73il@gmail.com> wrote:
>
> 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.
Thanks, applied.
Miklos
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-03-04 12:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-04 9:09 [PATCH] fuse: fix live lock in fuse_iget() Amir Goldstein
2021-03-04 12:37 ` Miklos Szeredi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.