linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2]  btrfs: send: fix failures when processing inodes with no links
@ 2022-08-11 10:09 bingjingc
  2022-08-11 10:09 ` [PATCH v2 1/2] btrfs: send: refactor get_inode_info() bingjingc
  2022-08-11 10:09 ` [PATCH v2 2/2] btrfs: send: fix failures when processing inodes with no links bingjingc
  0 siblings, 2 replies; 10+ messages in thread
From: bingjingc @ 2022-08-11 10:09 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 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(-)

-- 
2.37.1


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

end of thread, other threads:[~2022-09-23 15:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-11 10:09 [PATCH v2 0/2] btrfs: send: fix failures when processing inodes with no links bingjingc
2022-08-11 10:09 ` [PATCH v2 1/2] btrfs: send: refactor get_inode_info() bingjingc
2022-08-11 10:09 ` [PATCH v2 2/2] btrfs: send: fix failures when processing inodes with no links bingjingc
2022-08-11 12:00   ` Filipe Manana
2022-08-12 14:36     ` bingjing chang
2022-08-12 16:28       ` Filipe Manana
2022-08-18 13:46       ` David Sterba
2022-09-22 10:08       ` Filipe Manana
2022-09-23 14:16         ` bingjing chang
2022-09-23 15:32           ` Filipe Manana

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).