Skip to content

Commit 7a64774

Browse files
Christoph Hellwigjankara
authored andcommitted
quota: use lockdep_assert_held_write in dquot_load_quota_sb
Use lockdep_assert_held_write to assert and self-document the locking state in dquot_load_quota_sb instead of hand-crafting it with a trylock. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jan Kara <jack@suse.cz> Message-Id: <20230802115439.2145212-2-hch@lst.de>
1 parent 2363650 commit 7a64774

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

fs/quota/dquot.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2365,11 +2365,10 @@ int dquot_load_quota_sb(struct super_block *sb, int type, int format_id,
23652365
struct quota_info *dqopt = sb_dqopt(sb);
23662366
int error;
23672367

2368+
lockdep_assert_held_write(&sb->s_umount);
2369+
23682370
/* Just unsuspend quotas? */
23692371
BUG_ON(flags & DQUOT_SUSPENDED);
2370-
/* s_umount should be held in exclusive mode */
2371-
if (WARN_ON_ONCE(down_read_trylock(&sb->s_umount)))
2372-
up_read(&sb->s_umount);
23732372

23742373
if (!fmt)
23752374
return -ESRCH;

0 commit comments

Comments
 (0)