Re: [syzbot] [ext4?] WARNING in ext4_xattr_block_set (2)

From: Theodore Ts'o
Date: Wed May 03 2023 - 16:28:53 EST


#syz test git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4.git dev

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 39f00f05f981..dab33412b858 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -6638,6 +6638,14 @@ static int __ext4_remount(struct fs_context *fc, struct super_block *sb)
return 0;

restore_opts:
+ if ((sb->s_flags & SB_RDONLY) &&
+ !(old_sb_flags & SB_RDONLY)) {
+ ext4_warning(sb, "failing rw->ro transition");
+ if (sb_any_quota_suspended(sb)) {
+ ext4_warning(sb, "would resume quotas");
+// dquot_resume(sb, -1);
+ }
+ }
sb->s_flags = old_sb_flags;
sbi->s_mount_opt = old_opts.s_mount_opt;
sbi->s_mount_opt2 = old_opts.s_mount_opt2;