Skip to content

btrfs: fix lost error value deleting root reference

[email protected] linux-btrfs 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 6 repliesIn review
  2. v12 patches 0 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2btrfs: fix silent failure when deleting root referencefs/btrfs/root-tree.c+3 -23 replies
2/2btrfs: simplify error handling at btrfs_del_root_ref()fs/btrfs/root-tree.c+7 -92 replies

Reviews trailers per patch

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

PatchQu Wenruo
1/2R-b
2/2R-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/2] btrfs: fix lost error value deleting root reference

From: Filipe Manana <[email protected]>

Fix a silent failure in case deleting a root reference fails when searching for an item. Then make btrfs_del_root_ref() less likely to run into such type of bug in the future. Details in the changelogs.

V2: Fix patch 2/2. If the BTRFS_ROOT_BACKREF_KEY item is not found, but
the BTRFS_ROOT_REF_KEY is found, then before we would return -ENOENT and now we were returning 0 (unless an error happened when deleting the BTRFS_ROOT_REF_KEY item). Just return -ENOENT whenever one of the items is not found, all the callers abort the transaction if btrfs_del_root_ref() returns an error.

Filipe Manana (2):
btrfs: fix silent failure when deleting root reference
btrfs: simplify error handling at btrfs_del_root_ref()

 fs/btrfs/root-tree.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)
Signature · 1 line
2.35.1