Skip to content

Enhance btrfs_verify_dev_extents() to do more checks on dev extents

Qu Wenruo linux-btrfs 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 2 repliesIn review
  2. v12 patches 5 repliesSuperseded

Changes in v2 from the cover letter

Add "Link:" tag for the first patch.
Move the actual check into verify_one_dev_extent() for the 2nd patch.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2btrfs: volumes: Make sure there is no overlap dev extents at mount timefs/btrfs/volumes.c+14 -00 replies
2/2btrfs: volumes: Make sure no dev extent is beyond device boundaryfs/btrfs/volumes.c+17 -01 reply

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] Enhance btrfs_verify_dev_extents() to do more checks on dev extents

Inspired by Hans' possible flawed DUP chunk allocator, add the following dev extents checker:

1) Dev extent overlap check
Dev extents don't use extent_cache so it can't report dev extents overlap.
So manually check dev extents overlap.
This check is pretty simple since we're already iterating dev extents by its physical offset, we only need to remember previous checked dev extents to do such check.

2) Dev extent end check
No dev extent should go beyond device boundary.

These two checks are pretty cheap so it shouldn't bring any performance overhead.

Changelog:
v2:
Add "Link:" tag for the first patch.
Move the actual check into verify_one_dev_extent() for the 2nd patch.

Qu Wenruo (2):
btrfs: volumes: Make sure there is no overlap dev extents at mount
time
btrfs: volumes: Make sure no dev extent is beyond device boundary

 fs/btrfs/volumes.c | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
Signature · 1 line
2.19.0