public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] btrfs: send: fix sending link commands for existing file paths
@ 2022-07-12  1:36 bingjingc
  2022-07-12  1:36 ` [PATCH v2 1/2] btrfs: send: introduce recorded_ref_alloc and recorded_ref_free bingjingc
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: bingjingc @ 2022-07-12  1:36 UTC (permalink / raw)
  To: josef, dsterba, clm, linux-btrfs, linux-kernel
  Cc: fdmanana, bingjingc, robbieko, bxxxjxxg

From: BingJing Chang <bingjingc@synology.com>

There is a bug sending link commands for existing file paths. When we're
processing an inode, we go over all references. All the new file paths are
added to the "new_refs" list. And all the deleted file paths are added to
the "deleted_refs" list. In the end, when we finish processing the inode,
we iterate over all the items in the "new_refs" list and send link commands
for those file paths. After that, we go over all the items in the
"deleted_refs" list and send unlink commands for them. If there are
duplicated file paths in both lists, we will try to create them before we
remove them. Then the receiver gets an -EEXIST error when trying the link
operations.

BingJing Chang (2):
  btrfs: send: introduce recorded_ref_alloc and recorded_ref_free
  btrfs: send: fix sending link commands for existing file paths

 fs/btrfs/send.c | 195 ++++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 181 insertions(+), 14 deletions(-)

-- 
2.37.0


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

end of thread, other threads:[~2022-07-18 10:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-12  1:36 [PATCH v2 0/2] btrfs: send: fix sending link commands for existing file paths bingjingc
2022-07-12  1:36 ` [PATCH v2 1/2] btrfs: send: introduce recorded_ref_alloc and recorded_ref_free bingjingc
2022-07-12  1:36 ` [PATCH v2 2/2] btrfs: send: fix sending link commands for existing file paths bingjingc
2022-07-12 20:14   ` David Sterba
2022-07-12 14:52 ` [PATCH v2 0/2] " Filipe Manana
2022-07-18 10:39   ` bingjing chang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox