mbox series

[0/2] btrfs: send: fix a bug that sending a link command on existing file path

Message ID 20220706130903.1661-1-bingjingc@synology.com (mailing list archive)
Headers show
Series btrfs: send: fix a bug that sending a link command on existing file path | expand

Message

bingjingc July 6, 2022, 1:09 p.m. UTC
From: BingJing Chang <bingjingc@synology.com>

btrfs_ioctl_send processes recorded btrfs_keys in a defined order. (First,
we process a btrfs_key with a samller objectid. If btrfs_keys have the same
objectid, then we compare their types and offsets accordingly.) However,
reference paths for an inode can be stored in either BTRFS_INODE_REF_KEY
btrfs_keys or BTRFS_INODE_EXTREF_KEY btrfs_keys. And due to the limitation
of the helper function - iterate_inode_ref, we can only iterate the entries
of ONE btrfs_inode_ref or btrfs_inode_extref. That is, there must be a bug
in processing the same reference paths, which are stored in different ways.

Please see the second commit for the details.

bingjingc (2):
  btrfs: send: introduce recorded_ref_alloc and recorded_ref_free
  btrfs: send: fix a bug that sending a link command on existing file
    path

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