diff options
author | Chao Yu <chao@kernel.org> | 2023-04-02 13:27:06 +0200 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2023-04-13 05:00:36 +0200 |
commit | e1bb7d3d9cbf3ddcb8367d87b2f70757ec55f951 (patch) | |
tree | 3db9e05a07765d76836d3ccb441d6b1d5ff24818 /fs/f2fs/f2fs.h | |
parent | f2fs: fix to check readonly condition correctly (diff) | |
download | linux-e1bb7d3d9cbf3ddcb8367d87b2f70757ec55f951.tar.xz linux-e1bb7d3d9cbf3ddcb8367d87b2f70757ec55f951.zip |
f2fs: fix to recover quota data correctly
With -O quota mkfs option, xfstests generic/417 fails due to fsck detects
data corruption on quota inodes.
[ASSERT] (fsck_chk_quota_files:2051) --> Quota file is missing or invalid quota file content found.
The root cause is there is a hole f2fs doesn't hold quota inodes,
so all recovered quota data will be dropped due to SBI_POR_DOING
flag was set.
- f2fs_fill_super
- f2fs_recover_orphan_inodes
- f2fs_enable_quota_files
- f2fs_quota_off_umount
<--- quota inodes were dropped --->
- f2fs_recover_fsync_data
- f2fs_enable_quota_files
- f2fs_quota_off_umount
This patch tries to eliminate the hole by holding quota inodes
during entire recovery flow as below:
- f2fs_fill_super
- f2fs_recover_quota_begin
- f2fs_recover_orphan_inodes
- f2fs_recover_fsync_data
- f2fs_recover_quota_end
Then, recovered quota data can be persisted after SBI_POR_DOING
is cleared.
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/f2fs.h')
-rw-r--r-- | fs/f2fs/f2fs.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 30e31bb5c2ce..ede38bcef80e 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -1294,6 +1294,7 @@ enum { SBI_QUOTA_NEED_REPAIR, /* quota file may be corrupted */ SBI_IS_RESIZEFS, /* resizefs is in process */ SBI_IS_FREEZING, /* freezefs is in process */ + SBI_IS_WRITABLE, /* remove ro mountoption transiently */ MAX_SBI_FLAG, }; |