Message ID | 20240717085642.2154123-1-chao@kernel.org (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [f2fs-dev] f2fs-tools: fix to do not dump inode if it has F2FS_NODUMP_FL flag | expand |
diff --git a/fsck/dump.c b/fsck/dump.c index 8d5613e..1fb9a1d 100644 --- a/fsck/dump.c +++ b/fsck/dump.c @@ -605,6 +605,10 @@ static int dump_filesystem(struct f2fs_sb_info *sbi, struct node_info *ni, MSG(force, "Wrong name info\n\n"); return -1; } + if (le32_to_cpu(inode->i_flags) & F2FS_NODUMP_FL) { + MSG(force, "File has nodump flag\n\n"); + return -1; + } base_path = base_path ?: "./lost_found"; if (force) goto dump;
Quoted from manual of chattr: " CHATTR(1) ... ATTRIBUTES A file with the 'd' attribute set is not a candidate for backup when the dump(8) program is run. " Once we set F2FS_NODUMP_FL flag to inode, do not allow dumping info from it. Signed-off-by: Chao Yu <chao@kernel.org> --- fsck/dump.c | 4 ++++ 1 file changed, 4 insertions(+)