linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: bingjingc <bingjingc@synology.com>
To: fdmanana@kernel.org, josef@toxicpanda.com, dsterba@suse.com,
	clm@fb.com, linux-btrfs@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: bingjingc@synology.com, robbieko@synology.com, bxxxjxxg@gmail.com
Subject: [PATCH v2 0/2]  btrfs: send: fix failures when processing inodes with no links
Date: Thu, 11 Aug 2022 18:09:10 +0800	[thread overview]
Message-ID: <20220811100912.126447-1-bingjingc@synology.com> (raw)

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


             reply	other threads:[~2022-08-11 10:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-11 10:09 bingjingc [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220811100912.126447-1-bingjingc@synology.com \
    --to=bingjingc@synology.com \
    --cc=bxxxjxxg@gmail.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=fdmanana@kernel.org \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robbieko@synology.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).