Skip to contentSkip to conversation

f2fs-tools: fix to do not dump inode if it has F2FS_NODUMP_FL flag

PATCH New Chao Yu 1 participant 1 message Jul 17, 2024

lore
Share & tools
lore

Chao Yu

author
#0 lore raw

PATCH 1/1 f2fs-tools: fix to do not dump inode if it has F2FS_NODUMP_FL flag

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.

---
 fsck/dump.c | 4 ++++
 1 file changed, 4 insertions(+)
fsck/dump.c +4 -0
index 8d5613e..1fb9a1d 100644
@@ -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;
Signature · 8 lines
2.40.1



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel