Skip to content

Commit

Permalink
ext4: enable quotas before orphan cleanup
Browse files Browse the repository at this point in the history
When using quota feature we need to enable quotas before orphan cleanup
so that changes happening during it are properly reflected in quota
accounting.

Signed-off-by: Jan Kara <[email protected]>
Signed-off-by: "Theodore Ts'o" <[email protected]>
  • Loading branch information
jankara authored and tytso committed Mar 2, 2013
1 parent 262b466 commit 9b2ff35
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions fs/ext4/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -3933,6 +3933,16 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
if (err)
goto failed_mount7;

#ifdef CONFIG_QUOTA
/* Enable quota usage during mount. */
if (EXT4_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_QUOTA) &&
!(sb->s_flags & MS_RDONLY)) {
err = ext4_enable_quotas(sb);
if (err)
goto failed_mount8;
}
#endif /* CONFIG_QUOTA */

EXT4_SB(sb)->s_mount_state |= EXT4_ORPHAN_FS;
ext4_orphan_cleanup(sb, es);
EXT4_SB(sb)->s_mount_state &= ~EXT4_ORPHAN_FS;
Expand All @@ -3950,16 +3960,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
} else
descr = "out journal";

#ifdef CONFIG_QUOTA
/* Enable quota usage during mount. */
if (EXT4_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_QUOTA) &&
!(sb->s_flags & MS_RDONLY)) {
err = ext4_enable_quotas(sb);
if (err)
goto failed_mount8;
}
#endif /* CONFIG_QUOTA */

if (test_opt(sb, DISCARD)) {
struct request_queue *q = bdev_get_queue(sb->s_bdev);
if (!blk_queue_discard(q))
Expand Down

0 comments on commit 9b2ff35

Please sign in to comment.