Re: [syzbot] [jfs?] INFO: task hung in txBegin

From: Edward Adam Davis
Date: Sun Aug 04 2024 - 03:38:01 EST


with sb rwsem lock to order syncfs and wb worker

#syz test: upstream 50736169ecc8

diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index b865a3fa52f3..172ca9e1eed5 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -1865,6 +1865,7 @@ static long writeback_sb_inodes(struct super_block *sb,
long total_wrote = 0; /* count both pages and inodes */
unsigned long dirtied_before = jiffies;

+ printk("path1, sb: %p, %s\n", sb, __func__);
if (work->for_kupdate)
dirtied_before = jiffies -
msecs_to_jiffies(dirty_expire_interval * 10);
@@ -1993,6 +1994,7 @@ static long writeback_sb_inodes(struct super_block *sb,
break;
}
}
+ printk("path1,end sb: %p, total_wrote:%lu, %s\n", sb, total_wrote, __func__);
return total_wrote;
}

@@ -2720,6 +2722,7 @@ void writeback_inodes_sb_nr(struct super_block *sb,
unsigned long nr,
enum wb_reason reason)
{
+ printk("path2: nr: %lu, sb: %p, %s\n", nr, sb, __func__);
__writeback_inodes_sb_nr(sb, nr, reason, false);
}
EXPORT_SYMBOL(writeback_inodes_sb_nr);