Re: [syzbot] [ext4?] INFO: task hung in ext4_quota_write
From: Edward Adam Davis
Date: Fri Jan 05 2024 - 09:29:53 EST
please test task hung in ext4_quota_write
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git f5837722ffec
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index c5fcf377ab1f..cd9531db8472 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -7248,6 +7248,10 @@ static ssize_t ext4_quota_write(struct super_block *sb, int type,
brelse(bh);
return err;
}
+ if (test_bit(BH_Lock, &bh->b_state)) {
+ brelse(bh);
+ return -EIO;
+ }
lock_buffer(bh);
memcpy(bh->b_data+offset, data, len);
flush_dcache_page(bh->b_page);