Skip to content

btrfs-progs: make sure "mkfs --rootdir" copies all the attributes for the rootdir

Qu Wenruo linux-btrfs 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 5 repliesIn review
  2. v22 patches 0 repliesSuperseded
  3. v12 patches 2 repliesSuperseded

Changes in v3 from the cover letter

- Use 'stat()' instead pf 'lstate()' for the rootdir This would follow a softlink for the rootdir.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2btrfs-progs: mkfs/rootdir: copy missing attributes for the rootdir inodemkfs/rootdir.c+67 -214 replies
2/2btrfs-progs: tests/mkfs: make sure rootdir inode got its attributes copiedtests/mkfs-tests/027-rootdir-inode/test.sh+60 -00 replies

Reviews trailers per patch

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

Read the v3 thread

Cover letter [PATCH v3 0/2] btrfs-progs: make sure "mkfs --rootdir" copies all the attributes for the rootdir

[CHANGELOG]
v3:
- Use 'stat()' instead pf 'lstate()' for the rootdir This would follow a softlink for the rootdir.

v2:
- Add more attributes to be copied for rootdir, including:
* mode
* uid
* gid
* timestamps

- Update the test case
* Use two loopback devices
One to store the source directory, so that we're ensured to have xattr support.
* Add checks for all the uid/gid/mode attributes

We got a bug report that "mkfs.btrfs --rootdir" copies all the xattr but the xattr of the source directory.

It turns out that we only do the regular xattr/gid/uid/mode/timestamps copy for all the child inodes, not the source directory itself.

Fix it and create a test case for it.

Qu Wenruo (2):
btrfs-progs: mkfs/rootdir: copy missing attributes for the rootdir
inode
btrfs-progs: tests/mkfs: make sure rootdir inode got its attributes
copied

 mkfs/rootdir.c                             | 88 ++++++++++++++++------
 tests/mkfs-tests/027-rootdir-inode/test.sh | 60 +++++++++++++++
 2 files changed, 127 insertions(+), 21 deletions(-)
 create mode 100755 tests/mkfs-tests/027-rootdir-inode/test.sh

--
2.42.0