Skip to content

btrfs-progs: mkfs: --rootdir related fixes

Qu Wenruo linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2btrfs-progs: properly initialized extent generation for __btrfs_record_file_extent()kernel-shared/extent-tree.c+1 -12 replies
2/2btrfs-progs: avoid fs corruption if rootdir contains ino smaller than BTRFS_FIRST_FREE_OBJECTIDkernel-shared/extent-tree.c mkfs/rootdir.c+13 -10 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchAnand Jain
1/2R-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] btrfs-progs: mkfs: --rootdir related fixes

I don't know if it's recent kernel tmpfs change or something else, but I'm consistently get ino number smaller than 256 from my /tmp directory.

This behavior change exposed a new problem in mkfs.btrfs --rootdir, that if some ino number (in the source directory, not in btrfs) is smaller than 256, it can screw up the backref code.

As backref code is utilizing @owner to determine if a backref is data or metadata.

And inode number smaller than 256 will make backref code to treat a data backref as tree backref, and cause corruption.

Thankfully this should not happen that easily, only when --rootdir points to a newly created fs.

Qu Wenruo (2):
btrfs-progs: properly initialized extent generation for
__btrfs_record_file_extent()
btrfs-progs: avoid fs corruption if rootdir contains ino smaller than
BTRFS_FIRST_FREE_OBJECTID

 kernel-shared/extent-tree.c | 8 +++++++-
 mkfs/rootdir.c              | 8 +++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)
Signature · 1 line
2.37.3