fs/btrfs/send.c | 195 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 181 insertions(+), 14 deletions(-)
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
On Tue, Jul 12, 2022 at 09:36:30AM +0800, bingjingc wrote: > 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(-) Looks good now, thanks. Reviewed-by: Filipe Manana <fdmanana@suse.com> Also, are you planning on submitting a test case for fstests too? > > -- > 2.37.0 >
Filipe Manana <fdmanana@kernel.org>於 2022年7月12日 週二,下午10:52寫道: > > On Tue, Jul 12, 2022 at 09:36:30AM +0800, bingjingc wrote: > > 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(-) > > Looks good now, thanks. > > Reviewed-by: Filipe Manana <fdmanana@suse.com> > > Also, are you planning on submitting a test case for fstests too? Sorry for my late reply. I will try to add a test case to fstests, thanks for reminding me. > > > > > -- > > 2.37.0 > >
© 2016 - 2026 Red Hat, Inc.