linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] btrfs: send: fix a bug that sending unlink commands for directories
@ 2022-08-08 10:27 bingjingc
  2022-08-08 10:27 ` [PATCH 1/2] btrfs: send: refactor get_inode_info() bingjingc
  2022-08-08 10:27 ` [PATCH 2/2] btrfs: send: fix a bug that sending unlink commands for directories bingjingc
  0 siblings, 2 replies; 6+ messages in thread
From: bingjingc @ 2022-08-08 10:27 UTC (permalink / raw)
  To: fdmanana, josef, dsterba, clm, linux-btrfs, linux-kernel
  Cc: bingjingc, robbieko, bxxxjxxg

From: BingJing Chang <bingjingc@synology.com>

There is a bug sending unlink commands for directories. In
commit 46b2f4590aab ("Btrfs: fix send failure when root has deleted files
still open")', orphan inode issue was addressed. There're no reference
paths for these orphan inodes, so the send operation fails with an ENOENT
error. 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 reference paths found in the parent
snapshot. However, not only regular files but also directories can be
orphan inodes. So if it meets an orphan directory, a wrong unlink command
for this directory will be issued. Soon the unlink command fails with an
EISDIR error.


BingJing Chang (2):
  btrfs: send: refactor get_inode_info()
  btrfs: send: fix a bug that sending unlink commands for directories

 fs/btrfs/send.c | 390 +++++++++++++++++++++++-------------------------
 1 file changed, 189 insertions(+), 201 deletions(-)

-- 
2.37.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-08-11  6:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-08 10:27 [PATCH 0/2] btrfs: send: fix a bug that sending unlink commands for directories bingjingc
2022-08-08 10:27 ` [PATCH 1/2] btrfs: send: refactor get_inode_info() bingjingc
2022-08-08 16:17   ` Filipe Manana
2022-08-08 10:27 ` [PATCH 2/2] btrfs: send: fix a bug that sending unlink commands for directories bingjingc
2022-08-08 16:22   ` Filipe Manana
2022-08-11  6:09     ` bingjing chang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).