Skip to content

Btrfs: fixes for block group remove/allocation and trim/discard

Filipe Manana linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 15 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6Btrfs: fix invalid block group rbtree access after bg is removedfs/btrfs/extent-tree.c+13 -01 reply
2/6Btrfs: fix crash caused by block group removalfs/btrfs/ctree.h fs/btrfs/extent-tree.c+28 -05 replies
3/6Btrfs: fix freeing used extents after removing empty block groupfs/btrfs/extent-tree.c+10 -111 reply
4/6Btrfs: fix race between fs trimming and block group remove/allocationfs/btrfs/ctree.h fs/btrfs/disk-io.c fs/btrfs/extent-tree.c +2 more+100 -106 replies
5/6Btrfs: fix race between writing free space cache and trimmingfs/btrfs/free-space-cache.c fs/btrfs/free-space-cache.h fs/btrfs/inode-map.c+60 -31 reply
6/6Btrfs: make btrfs_abort_transaction consider existence of new block groupsfs/btrfs/extent-tree.c fs/btrfs/super.c+4 -35 replies

Reviews trailers per patch

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

PatchJosef Bacik
1/6R-b
2/6
3/6R-b
4/6
5/6
6/6R-b

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] Btrfs: fixes for block group remove/allocation and trim/discard

This patchset fixes several issues exposed by block group removal/allocation and trim/discard running in parallel.

The first 3 patches and the last one (6) are independent and don't depend on each other. Patches 3 and 6 are not really related to trim/discard at all.

I bundled all these patches into the same patchset because all these issues were triggered by the same test for xfstests that I prepared and will send out soon. The issues were triggered on a qemu/kvm guest using scsi-hd drives with discard support enabled (which makes the host do hole punching on the virtual disks' image files), 4 virtual CPUs and 4Gb of ram. Some of these issues were hard to trigger and happened like once for every 10+ runs of the test (each test run takes nearly 30 minutes with my hardware and a debug kernel).

Filipe Manana (6):
Btrfs: fix invalid block group rbtree access after bg is removed
Btrfs: fix crash caused by block group removal
Btrfs: fix freeing used extents after removing empty block group
Btrfs: fix race between fs trimming and block group remove/allocation
Btrfs: fix race between writing free space cache and trimming
Btrfs: make btrfs_abort_transaction consider existence of new block
groups

 fs/btrfs/ctree.h            | 14 ++++++-
 fs/btrfs/disk-io.c          | 14 +++++++
 fs/btrfs/extent-tree.c      | 90 ++++++++++++++++++++++++++++++++++++++-------
 fs/btrfs/free-space-cache.c | 85 ++++++++++++++++++++++++++++++++++++++++--
 fs/btrfs/free-space-cache.h |  2 +
 fs/btrfs/inode-map.c        |  2 +
 fs/btrfs/super.c            |  2 +-
 fs/btrfs/volumes.c          | 33 +++++++++++++----
 8 files changed, 215 insertions(+), 27 deletions(-)
Signature · 1 line
2.1.3