diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-10-06 12:14:28 -0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-11-05 19:42:02 -0500 |
commit | ea6767337f86312ebe473585899a159bf50ef1b7 (patch) | |
tree | ca1ba28580c124af5aaa3dc5f106d5bbbe322113 /fs/f2fs/recovery.c | |
parent | 234a9689614272d93271b308adbd303b59d266e3 (diff) |
f2fs: support quota sys files
This patch supports hidden quota files in the system, which will be used for
Android. It requires up-to-date f2fs-tools later than v1.9.0.
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/recovery.c')
-rw-r--r-- | fs/f2fs/recovery.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c index 9626758bc762..92c57ace1939 100644 --- a/fs/f2fs/recovery.c +++ b/fs/f2fs/recovery.c | |||
@@ -594,6 +594,9 @@ int recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only) | |||
594 | int ret = 0; | 594 | int ret = 0; |
595 | unsigned long s_flags = sbi->sb->s_flags; | 595 | unsigned long s_flags = sbi->sb->s_flags; |
596 | bool need_writecp = false; | 596 | bool need_writecp = false; |
597 | #ifdef CONFIG_QUOTA | ||
598 | int quota_enabled; | ||
599 | #endif | ||
597 | 600 | ||
598 | if (s_flags & MS_RDONLY) { | 601 | if (s_flags & MS_RDONLY) { |
599 | f2fs_msg(sbi->sb, KERN_INFO, "orphan cleanup on readonly fs"); | 602 | f2fs_msg(sbi->sb, KERN_INFO, "orphan cleanup on readonly fs"); |
@@ -604,7 +607,7 @@ int recover_fsync_data(struct f2fs_sb_info *sbi, bool check_only) | |||
604 | /* Needed for iput() to work correctly and not trash data */ | 607 | /* Needed for iput() to work correctly and not trash data */ |
605 | sbi->sb->s_flags |= MS_ACTIVE; | 608 | sbi->sb->s_flags |= MS_ACTIVE; |
606 | /* Turn on quotas so that they are updated correctly */ | 609 | /* Turn on quotas so that they are updated correctly */ |
607 | f2fs_enable_quota_files(sbi); | 610 | quota_enabled = f2fs_enable_quota_files(sbi, s_flags & MS_RDONLY); |
608 | #endif | 611 | #endif |
609 | 612 | ||
610 | fsync_entry_slab = f2fs_kmem_cache_create("f2fs_fsync_inode_entry", | 613 | fsync_entry_slab = f2fs_kmem_cache_create("f2fs_fsync_inode_entry", |
@@ -665,7 +668,8 @@ skip: | |||
665 | out: | 668 | out: |
666 | #ifdef CONFIG_QUOTA | 669 | #ifdef CONFIG_QUOTA |
667 | /* Turn quotas off */ | 670 | /* Turn quotas off */ |
668 | f2fs_quota_off_umount(sbi->sb); | 671 | if (quota_enabled) |
672 | f2fs_quota_off_umount(sbi->sb); | ||
669 | #endif | 673 | #endif |
670 | sbi->sb->s_flags = s_flags; /* Restore MS_RDONLY status */ | 674 | sbi->sb->s_flags = s_flags; /* Restore MS_RDONLY status */ |
671 | 675 | ||