Skip to content

btrfs-progs: mkfs/rootdir: add hard link support

Qu Wenruo linux-btrfs 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 0 repliesNew
  2. v12 patches 0 repliesSuperseded

Changes in v2 from the cover letter

- Fix several grammar errors and change "can not" to more formal "cannot"
- Initialize the temporary hardlink_entry structure as const
- Double quote the $nr_hardlink used in test case

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2btrfs-progs: mkfs/rootdir: add hard link supportDocumentation/mkfs.btrfs.rst mkfs/rootdir.c+185 -310 replies
2/2btrfs-progs: mkfs-tests: add hardlink related tests for --subvolmkfs/rootdir.c tests/mkfs-tests/036-rootdir-subvol/test.sh+68 -180 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/2] btrfs-progs: mkfs/rootdir: add hard link support

[Changelog]
v2:
- Fix several grammar errors and change "can not" to more formal "cannot"
- Initialize the temporary hardlink_entry structure as const
- Double quote the $nr_hardlink used in test case

With the recently reworked --rootdir support, although it solves several hard link related problems, it splits the hard links into new inodes.

And on each split, it shows a warning on each file with hardlinks.

Although the split behavior doesn't cause any data corruption, it can still be pretty noisy for rootfs creation, as there are a lot of distros storing timezone files as hardlinks.

This patchset adds back the hard link detection and creation, with enhanced handling to co-operate with --subvol option.

The details can be found in the first patch, with the new corner case introduced by --subvol option.

The second patch enhances the existing --rootdir and --subvol test case with extra corner cases like hard links, and hard links split by subvolume boundary.

Qu Wenruo (2):
btrfs-progs: mkfs/rootdir: add hard link support
btrfs-progs: mkfs-tests: add hardlink related tests for --subvol

 Documentation/mkfs.btrfs.rst                |  13 ++
 mkfs/rootdir.c                              | 199 +++++++++++++++++---
 tests/mkfs-tests/036-rootdir-subvol/test.sh |  78 ++++++--
 3 files changed, 247 insertions(+), 43 deletions(-)

--
2.46.0