Skip to content

Chunk allocator DUP fix and cleanups

Hans van Kranenburg linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 19 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6btrfs: alloc_chunk: do not refurbish num_bytesfs/btrfs/volumes.c+3 -22 replies
2/6btrfs: alloc_chunk: improve chunk size variable namefs/btrfs/volumes.c+7 -52 replies
3/6btrfs: alloc_chunk: fix more DUP stripe size handlingfs/btrfs/volumes.c+7 -100 replies
4/6btrfs: fix ncopies raid_attr for RAID56fs/btrfs/volumes.c+2 -21 reply
5/6btrfs: introduce nparity raid_attrfs/btrfs/volumes.c fs/btrfs/volumes.h+13 -73 replies
6/6btrfs: alloc_chunk: rework chunk/stripe calculationsfs/btrfs/volumes.c fs/btrfs/volumes.h+22 -260 replies

Reviews trailers per patch

3 of 6 patches have a Reviewed-by or Acked-by.

PatchNikolay Borisov
1/6R-b
2/6R-b
3/6
4/6R-b
5/6
6/6

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/6] Chunk allocator DUP fix and cleanups

This patch set contains an additional fix for a newly exposed bug after the previous attempt to fix a chunk allocator bug for new DUP chunks:

https://lore.kernel.org/linux-btrfs/[email protected]/T/#m609ccb5d32998e8ba5cfa9901c1ab56a38a6f374

The DUP fix is "fix more DUP stripe size handling". I did that one before starting to change more things so it can be applied to earlier LTS kernels.

Besides that patch, which is fixing the bug in a way that is least intrusive, I added a bunch of other patches to help getting the chunk allocator code in a state that is a bit less error-prone and bug-attracting.

When running this and trying the reproduction scenario, I can now see that the created DUP device extent is 827326464 bytes long, which is good.

I wrote and tested this on top of linus 4.19-rc5. I still need to create a list of related use cases and test more things to at least walk through a bunch of obvious use cases to see if there's nothing exploding too quickly with these changes. However, I'm quite confident about it, so I'm sharing all of it already.

Any feedback and review is appreciated. Be gentle and keep in mind that I'm still very much in a learning stage regarding kernel development.

The stable patches handling workflow is not 100% clear to me yet. I guess I have to add a Fixes: in the DUP patch which points to the previous commit 92e222df7b.

Moo!,
Knorrie

Hans van Kranenburg (6):
btrfs: alloc_chunk: do not refurbish num_bytes
btrfs: alloc_chunk: improve chunk size variable name
btrfs: alloc_chunk: fix more DUP stripe size handling
btrfs: fix ncopies raid_attr for RAID56
btrfs: introduce nparity raid_attr
btrfs: alloc_chunk: rework chunk/stripe calculations

 fs/btrfs/volumes.c | 84 +++++++++++++++++++++++-----------------------
 fs/btrfs/volumes.h |  4 ++-
 2 files changed, 45 insertions(+), 43 deletions(-)
Signature · 1 line
2.19.0.329.g76f2f5c1e3