From: Christoph Hellwig Date: Wed, 2 Aug 2023 11:54:39 +0000 (+0200) Subject: quota: use lockdep_assert_held_write in dquot_load_quota_sb X-Git-Tag: v6.6.17~4075^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7a64774add85ce673a089810fae193b02003be24;hp=2363650b22ed3c8bbe7700789e399a77096ac931;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: Jan Kara Message-Id: <20230802115439.2145212-2-hch@lst.de> --- diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index e823224..303632f 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -2365,11 +2365,10 @@ int dquot_load_quota_sb(struct super_block *sb, int type, int format_id, struct quota_info *dqopt = sb_dqopt(sb); int error; + lockdep_assert_held_write(&sb->s_umount); + /* Just unsuspend quotas? */ BUG_ON(flags & DQUOT_SUSPENDED); - /* s_umount should be held in exclusive mode */ - if (WARN_ON_ONCE(down_read_trylock(&sb->s_umount))) - up_read(&sb->s_umount); if (!fmt) return -ESRCH;