Skip to content

btrfs: cleanup related to the 1MiB reserved space

Qu Wenruo linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 13 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2btrfs: introduce BTRFS_DEFAULT_RESERVED macrofs/btrfs/ctree.h fs/btrfs/extent-tree.c fs/btrfs/super.c +1 more+16 -145 replies
2/2btrfs: warn about dev extents that are inside the reserved rangefs/btrfs/volumes.c+10 -05 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/2] btrfs: cleanup related to the 1MiB reserved space

The 1MiB reserved space is only introduced in v4.1 btrfs-progs, and kernel has the same reserved space around the same time.

But there are two small nitpicks:

- Kernel never has a unified MACRO for this
We just use SZ_1M, with extra comments on this.

This makes later write-intent bitmap harder to implement, as the incoming write-intent bitmap will enlarge the reserved space to 2MiB, and use the extra 1MiB for write-intent bitmap. (of course with extra RO compat flags)

This will be addressed in the first patch, with a new BTRFS_DEFAULT_RESERVED macro.

Later write-intent bitmap code will use BTRFS_DEFAULT_RESERVED as a beacon to ensure btrfs never touches the enlarged reserved space.

- No warning on such very old fses.
Although kernel can handle such old fses without any problem, it's still better to output a warning, with a solution (just balance).

For now, we only need a warning, but for the incoming write-intent bitmap, any dev extents inside the extra reserved space will be rejected.

Qu Wenruo (2):
btrfs: introduce BTRFS_DEFAULT_RESERVED macro
btrfs: warn about dev extents that are inside the reserved range

 fs/btrfs/ctree.h       |  7 +++++++
 fs/btrfs/extent-tree.c |  6 +++---
 fs/btrfs/super.c       | 10 +++++-----
 fs/btrfs/volumes.c     | 17 +++++++++++------
 4 files changed, 26 insertions(+), 14 deletions(-)
Signature · 1 line
2.36.1