@@ -1165,12 +1165,12 @@ static void dump_orphan_list(struct super_block *sb, struct ext4_sb_info *sbi)
1165
1165
#ifdef CONFIG_QUOTA
1166
1166
static int ext4_quota_off (struct super_block * sb , int type );
1167
1167
1168
- static inline void ext4_quota_off_umount (struct super_block * sb )
1168
+ static inline void ext4_quotas_off (struct super_block * sb , int type )
1169
1169
{
1170
- int type ;
1170
+ BUG_ON ( type > EXT4_MAXQUOTAS ) ;
1171
1171
1172
1172
/* Use our quota_off function to clear inode flags etc. */
1173
- for (type = 0 ; type < EXT4_MAXQUOTAS ; type ++ )
1173
+ for (type -- ; type >= 0 ; type -- )
1174
1174
ext4_quota_off (sb , type );
1175
1175
}
1176
1176
@@ -1186,7 +1186,7 @@ static inline char *get_qf_name(struct super_block *sb,
1186
1186
lockdep_is_held (& sb -> s_umount ));
1187
1187
}
1188
1188
#else
1189
- static inline void ext4_quota_off_umount (struct super_block * sb )
1189
+ static inline void ext4_quotas_off (struct super_block * sb , int type )
1190
1190
{
1191
1191
}
1192
1192
#endif
@@ -1286,7 +1286,7 @@ static void ext4_put_super(struct super_block *sb)
1286
1286
& sb -> s_uuid );
1287
1287
1288
1288
ext4_unregister_li_request (sb );
1289
- ext4_quota_off_umount (sb );
1289
+ ext4_quotas_off (sb , EXT4_MAXQUOTAS );
1290
1290
1291
1291
flush_work (& sbi -> s_error_work );
1292
1292
destroy_workqueue (sbi -> rsv_conversion_wq );
@@ -5597,7 +5597,7 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
5597
5597
return 0 ;
5598
5598
5599
5599
failed_mount10 :
5600
- ext4_quota_off_umount (sb );
5600
+ ext4_quotas_off (sb , EXT4_MAXQUOTAS );
5601
5601
failed_mount9 : __maybe_unused
5602
5602
ext4_release_orphan_info (sb );
5603
5603
failed_mount8 :
@@ -7044,20 +7044,8 @@ int ext4_enable_quotas(struct super_block *sb)
7044
7044
"(type=%d, err=%d, ino=%lu). "
7045
7045
"Please run e2fsck to fix." , type ,
7046
7046
err , qf_inums [type ]);
7047
- for (type -- ; type >= 0 ; type -- ) {
7048
- struct inode * inode ;
7049
-
7050
- inode = sb_dqopt (sb )-> files [type ];
7051
- if (inode )
7052
- inode = igrab (inode );
7053
- dquot_quota_off (sb , type );
7054
- if (inode ) {
7055
- lockdep_set_quota_inode (inode ,
7056
- I_DATA_SEM_NORMAL );
7057
- iput (inode );
7058
- }
7059
- }
7060
7047
7048
+ ext4_quotas_off (sb , type );
7061
7049
return err ;
7062
7050
}
7063
7051
}
0 commit comments