summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2023-10-20 13:23:51 +0200
committerJan Kara <jack@suse.cz>2024-01-22 12:56:20 +0100
commitd44c576637238d2dafdd22dc856f0cb2a1553049 (patch)
treebd0ae9c42c99340c6cfb61af3adb689723331208 /fs
parentc8238508c85e262d46e19e2ff039d9238d436321 (diff)
quota: Remove BUG_ON in dquot_load_quota_sb()
The case when someone passes DQUOT_SUSPENDED flag to dquot_load_quota_sb() is easy to handle. So just WARN_ON_ONCE and bail with error if that happens instead of calling BUG_ON which is likely to lockup the machine. Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs')
-rw-r--r--fs/quota/dquot.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index d863d6b1ff97..85edbbafaaa4 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -2385,7 +2385,8 @@ int dquot_load_quota_sb(struct super_block *sb, int type, int format_id,
lockdep_assert_held_write(&sb->s_umount);
/* Just unsuspend quotas? */
- BUG_ON(flags & DQUOT_SUSPENDED);
+ if (WARN_ON_ONCE(flags & DQUOT_SUSPENDED))
+ return -EINVAL;
if (!fmt)
return -ESRCH;