Skip to content

Commit d44c576

Browse files
committed
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 <[email protected]>
1 parent c823850 commit d44c576

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/quota/dquot.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2385,7 +2385,8 @@ int dquot_load_quota_sb(struct super_block *sb, int type, int format_id,
23852385
lockdep_assert_held_write(&sb->s_umount);
23862386

23872387
/* Just unsuspend quotas? */
2388-
BUG_ON(flags & DQUOT_SUSPENDED);
2388+
if (WARN_ON_ONCE(flags & DQUOT_SUSPENDED))
2389+
return -EINVAL;
23892390

23902391
if (!fmt)
23912392
return -ESRCH;

0 commit comments

Comments
 (0)