Skip to content

btrfs: some free space cache fixes and updates

[email protected] linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9btrfs: fix space cache inconsistency after error loading it from diskfs/btrfs/free-space-cache.c+4 -31 reply
2/9btrfs: avoid extra memory allocation when copying free space cachefs/btrfs/free-space-cache.c+4 -21 reply
3/9btrfs: avoid searching twice for previous node when merging free space entriesfs/btrfs/free-space-cache.c+7 -30 replies
4/9btrfs: use precomputed end offsets at do_trimming()fs/btrfs/free-space-cache.c+1 -11 reply
5/9btrfs: simplify arguments to tree_insert_offset()fs/btrfs/free-space-cache.c+16 -210 replies
6/9btrfs: assert proper locks are held at tree_insert_offset()fs/btrfs/free-space-cache.c+19 -60 replies
7/9btrfs: assert tree lock is held when searching for free space entriesfs/btrfs/free-space-cache.c+2 -01 reply
8/9btrfs: assert tree lock is held when linking free spacefs/btrfs/free-space-cache.c+2 -01 reply
9/9btrfs: assert tree lock is held when removing free space entriesfs/btrfs/free-space-cache.c+24 -100 replies

Reviews trailers per patch

5 of 9 patches have a Reviewed-by or Acked-by.

PatchAnand Jain
1/9R-b
2/9R-b
3/9
4/9R-b
5/9
6/9
7/9R-b
8/9R-b
9/9

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/9] btrfs: some free space cache fixes and updates

From: Filipe Manana <[email protected]>

Several updates to the free space cache code (most of it to the in memory data structure, shared between the free space cache and the free space tree). A bug fix, some cleanups, minor optimizations and adding several asserts to verify we are holding the necessary lock(s) when udpating the in memory space cache - this was motivated by an attempt to debug an invalid memory access when manipulating the in memory free space cache, as I suspected we had some code path not taking a required lock before manipulating the in memory red black tree of free space entries.

Filipe Manana (9):
btrfs: fix space cache inconsistency after error loading it from disk
btrfs: avoid extra memory allocation when copying free space cache
btrfs: avoid searching twice for previous node when merging free space entries
btrfs: use precomputed end offsets at do_trimming()
btrfs: simplify arguments to tree_insert_offset()
btrfs: assert proper locks are held at tree_insert_offset()
btrfs: assert tree lock is held when searching for free space entries
btrfs: assert tree lock is held when linking free space
btrfs: assert tree lock is held when removing free space entries

 fs/btrfs/free-space-cache.c | 111 +++++++++++++++++++++++-------------
 1 file changed, 72 insertions(+), 39 deletions(-)
Signature · 1 line
2.35.1