summaryrefslogtreecommitdiff
path: root/fs/ext4/super.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2023-06-16 18:50:52 +0200
committerTheodore Ts'o <tytso@mit.edu>2023-07-29 18:37:53 -0400
commite0e985f3f8941438a66ab8abb94cb011b9fb39a7 (patch)
tree7a651809d3378d6a399b95716ed11a76ef51d8d7 /fs/ext4/super.c
parent95257987a6387f02970eda707e55a06cce734e18 (diff)
ext4: avoid starting transaction on read-only fs in ext4_quota_off()
When the filesystem gets first remounted read-only and then unmounted, ext4_quota_off() will try to start a transaction (and fail) on read-only filesystem to cleanup inode flags for legacy quota files. Just bail before trying to start a transaction instead since that is going to issue a warning. Signed-off-by: Jan Kara <jack@suse.cz> Link: https://lore.kernel.org/r/20230616165109.21695-6-jack@suse.cz Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r--fs/ext4/super.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 20a8e64da4ac..a9a7c38c7442 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -7072,6 +7072,13 @@ static int ext4_quota_off(struct super_block *sb, int type)
err = dquot_quota_off(sb, type);
if (err || ext4_has_feature_quota(sb))
goto out_put;
+ /*
+ * When the filesystem was remounted read-only first, we cannot cleanup
+ * inode flags here. Bad luck but people should be using QUOTA feature
+ * these days anyway.
+ */
+ if (sb_rdonly(sb))
+ goto out_put;
inode_lock(inode);
/*