Skip to contentSkip to conversation

ext4: do not get s_umount sem on ext4_quota_off

PATCH Dmitry Monakhov 2 participants 2 messages Oct 9, 2010 – Oct 11, 2010 ext4 file system

lore
Share & tools
lore
#0 lore raw

It must be already acquired by caller. Fix lock_dep complain.

fs/ext4/super.c +3 -5
index e59eb37..062d1bc 100644
@@ -4107,12 +4107,10 @@ static int ext4_quota_on(struct super_block *sb, int type, int format_id,
 
 static int ext4_quota_off(struct super_block *sb, int type)
 {
-	/* Force all delayed allocation blocks to be allocated */
-	if (test_opt(sb, DELALLOC)) {
-		down_read(&sb->s_umount);
+	/* Force all delayed allocation blocks to be allocated.
+	 * Caller already holds s_umount sem */
+	if (test_opt(sb, DELALLOC))
 		sync_filesystem(sb);
-		up_read(&sb->s_umount);
-	}
 
 	return dquot_quota_off(sb, type);
 }
reviewer
#1 lore raw
Quoted 1 line · Dmitry Monakhov

It must be already acquired by caller. Fix lock_dep complain.

The patch is OK, but Ted usually merges ext4 patches (even quota related,
unless they are dependent on other generic quota stuff).

Honza

Quoted 23 lines
fs/ext4/super.c +3 -5
index e59eb37..062d1bc 100644
@@ -4107,12 +4107,10 @@ static int ext4_quota_on(struct super_block *sb, int type, int format_id,
 
 static int ext4_quota_off(struct super_block *sb, int type)
 {
-	/* Force all delayed allocation blocks to be allocated */
-	if (test_opt(sb, DELALLOC)) {
-		down_read(&sb->s_umount);
+	/* Force all delayed allocation blocks to be allocated.
+	 * Caller already holds s_umount sem */
+	if (test_opt(sb, DELALLOC))
 		sync_filesystem(sb);
-		up_read(&sb->s_umount);
-	}
 
 	return dquot_quota_off(sb, type);
 }
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR