Skip to content

btrfs: send: fix failures when processing inodes with no links

bingjingc linux-btrfs lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 3 repliesIn review
  2. v22 patches 7 repliesSuperseded
  3. v12 patches 3 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2btrfs: send: refactor get_inode_info()fs/btrfs/send.c+79 -751 reply
2/2brfs: send: fix failures when processing inodes with no linksfs/btrfs/send.c+85 -1291 reply

Reviews trailers per patch

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

PatchRobbie KoFilipe Manana
1/2R-b R-b
2/2R-b R-b

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

Read the v3 thread

Cover letter [PATCH v3 0/2] btrfs: send: fix failures when processing inodes with no links

From: BingJing Chang <[email protected]>

There is a bug causing send failures when processing an orphan directory with no links. In commit 46b2f4590aab ("Btrfs: fix send failure when root has deleted files still open")', the orphan inode issue was addressed. The send operation fails with a ENOENT error because of any attempts to generate a path for the inode with a link count of zero. Therefore, in that patch, sctx->ignore_cur_inode was introduced to be set if the current inode has a link count of zero for bypassing some unnecessary steps. And a helper function btrfs_unlink_all_paths() was introduced and called to clean up old paths found in the parent snapshot. However, not only regular files but also directories can be orphan inodes. So if the send operation meets an orphan directory, it will issue a wrong unlink command for that directory now. Soon the receive operation fails with a EISDIR error. Besides, the send operation also fails with a ENOENT error later when it tries to generate a path of it.

BingJing Chang (2):
btrfs: send: refactor get_inode_info()
btrfs: send: fix failures when processing inodes with no links

 fs/btrfs/send.c | 364 +++++++++++++++++++++---------------------------
 1 file changed, 162 insertions(+), 202 deletions(-)
Signature · 1 line
2.37.1