Skip to content

btrfs: fix problem with balance recovery and snap delete

Josef Bacik linux-btrfs lkml oe-lkp 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 5 repliesIn review
  2. v13 patches 1 replySuperseded

Changes in v2 from the cover letter

- reworked the fix based on Filipe's feedback. Instead of just doing all the snapshot delete at mount time simply keep track of any in-progress drops. Then gate relocation on those drops finishing. Once the drops finish we unblock relocation and carry on like normal.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3btrfs: do not start relocation until in progress drops are donefs/btrfs/ctree.h fs/btrfs/disk-io.c fs/btrfs/extent-tree.c +4 more+95 -11 reply
2/3btrfs: use btrfs_fs_info for deleting snapshots and cleanerfs/btrfs/disk-io.c fs/btrfs/transaction.c fs/btrfs/transaction.h+6 -71 reply
3/3btrfs: pass btrfs_fs_info to btrfs_recover_relocationfs/btrfs/ctree.h fs/btrfs/disk-io.c fs/btrfs/relocation.c+4 -51 reply

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchFilipe Manana
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] btrfs: fix problem with balance recovery and snap delete

v1->v2:
- reworked the fix based on Filipe's feedback. Instead of just doing all the snapshot delete at mount time simply keep track of any in-progress drops. Then gate relocation on those drops finishing. Once the drops finish we unblock relocation and carry on like normal.

--- Original email ---
Hello,

I found a problem where we'll try to add refs to blocks that no longer have references because we started a relocation while we had a half deleted snapshot in the file system. This only occurs on a clean mount with a pending snapshot delete in place. I saw this in production but lost the file system before I could test my patch. However I reproduced it locally with some error injection. Without my patch we'd fail to run delayed refs with the warning in the commit message in the first patch, with my patch we mount and can use the file system.

The other two patches are just cleanups that i noticed while messing with this code. Thanks,

Josef

Josef Bacik (3):
btrfs: do not start relocation until in progress drops are done
btrfs: use btrfs_fs_info for deleting snapshots and cleaner
btrfs: pass btrfs_fs_info to btrfs_recover_relocation

 fs/btrfs/ctree.h       | 15 ++++++++++++++-
 fs/btrfs/disk-io.c     | 19 ++++++++++++++-----
 fs/btrfs/extent-tree.c |  7 +++++++
 fs/btrfs/relocation.c  | 19 ++++++++++++++++---
 fs/btrfs/root-tree.c   | 18 ++++++++++++++++++
 fs/btrfs/transaction.c | 37 ++++++++++++++++++++++++++++++++++---
 fs/btrfs/transaction.h |  3 ++-
 7 files changed, 105 insertions(+), 13 deletions(-)
Signature · 1 line
2.26.3