This patch introduces a new feature, F2FS_FEATURE_LOST_FOUND, which
is set by mkfs. It creates a directory named lost+found, which saves
unreachable files. If fsck finds a file which has no parent, or its
parent is removed by fsck, the file will be placed under lost+found
directory by fsck.
In sanity_check_nid, __check_inode_mode will check i_mode value of an
inode. So integrate sanity_check_inode to __check_inode_mode to clean
up the code.
Signed-off-by: Sheng Yong
---
fsck/fsck.c | 33 +++--
1 file changed, 11 insertions(+), 22
fsck will cache all valid nat entries in memory. But when we try to
get a nat entry which is not cached, for example allocate a new nid
during reconnecting files, we need to read the uncached nat entry
from nat block again.
Signed-off-by: Sheng Yong
---
fsck/mount.c | 4
Introduce new parameters in f2fs_configuration for mkfs:
* next_free_nid: save the next free nid
* quota_inum: save how many blocks are used for quota inodes
* quota_dnum: save how many blocks are used for quota data
Use these parameters to avoid duplicated count of these values. And
Signed-off-by: Sheng Yong
Reviewed-by: Chao Yu
---
lib/libf2fs.c | 18 ++
1 file changed, 2 insertions(+), 16 deletions(-)
diff --git a/lib/libf2fs.c b/lib/libf2fs.c
index e8b1842..0c684d5 100644
--- a/lib/libf2fs.c
+++ b/lib/libf2fs.c
This patch introduces a new feature F2FS_FEATURE_LOST_FOUND. It can be
switched on by indicating `-O lost_found'. If LOST_FOUND feature is
enabled, an empty directory lost+found is created by mkfs.
This is a preparation for fsck. During fsck, the directory is used to
save unreachable files, which
This patch introduces lost_found feature to fsck. If a file is found
unreachable by fsck. Fsck tries to reconnect the file to lost+found
directory:
1. Scan all unreachable file inodes, ignore non-inodes ones and
directories.
2. Check them and fix incorrupted data to make sure filesystem
v2->v1:
* discard obsolete dnodes after all inodes are created.
* add new error message if file type (i_mode) is totally wrong.
* change "-O lost+found" to "-O lost_found".
* only set filename and bitmap in the second slot of lost+found dentry.
* handle inode_crtime when creating
Signed-off-by: Sheng Yong
---
fsck/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fsck/main.c b/fsck/main.c
index 804f71a..bbf82c3 100644
--- a/fsck/main.c
+++ b/fsck/main.c
@@ -137,7 +137,7 @@ static void error_out(char *prog)
else if
Enable in-memory inode checksum to protect metadata blocks
from in-memory scribbles only when checking consistency with
no performance requirements.
Signed-off-by: Weichao Guo
---
fs/f2fs/inode.c | 7 +++
fs/f2fs/node.c | 5 +
2 files changed, 12 insertions(+)
10 matches
Mail list logo