btrfs-progs/mkfs
Qu Wenruo 27974edb4d btrfs-progs: mkfs: warn about hard links with --rootdir
The recent rework changes how we detect hard links.

[OLD BEHAVIOR]
We trusted st_nlink and st_ino, reuse them without extra sanity
checks.

That behavior has problems handling cross mount-point or hard links out
of the rootdir cases.

[NEW BEHAVIOR]
The new refactored code will treat every inode, no matter if it's a
hardlink, as a new inode.

This means we will break the hard link detection, and every hard link
will be created as a different inode.

For the most common use case, like populating a rootfs, it's totally
fine.

[EXTRA WARNING]
But for cases where the user have extra hard links inside the rootdir,
output a warning just to inform the end user.

This will not cause any content difference, just breaking the hard links
into new inodes.

Signed-off-by: Qu Wenruo <wqu@suse.com>
2024-08-14 23:58:32 +02:00
..
Makefile
common.c btrfs-progs: introduce btrfs_make_subvolume() 2024-07-30 19:54:04 +02:00
common.h btrfs-progs: introduce btrfs_make_subvolume() 2024-07-30 19:54:04 +02:00
main.c btrfs-progs: mkfs: simplify mkfs_main() cleanup 2024-07-30 20:04:38 +02:00
rootdir.c btrfs-progs: mkfs: warn about hard links with --rootdir 2024-08-14 23:58:32 +02:00
rootdir.h btrfs-progs: mkfs: rework how we traverse rootdir 2024-08-14 23:58:27 +02:00