Skip to contentSkip to conversation

question about copy_file_range() between btrfs filesystem.

DISCUSSION Wang Yugui 2 participants 2 messages Jan 11, 2023 – Jan 20, 2023 Btrfs file system

lore
Share & tools
lore

Wang Yugui

author
#0 lore raw

Hi,

question about copy_file_range() between btrfs filesystem.

test progam:
attachment file(copy directly from 'man copy_file_range')

test result:
kernel: 6.1.4
1)in/out files in single btrfs subvol: OK

2)in/out files in single btrfs filesystem, but different subvols: OK

3)in/out files in different btrfs filesystems: ERROR Invalid cross-device link
but as a compare, in/out files in different nfs filesystems(in same server): OK.
Question:
Should we support copy_file_range() between btrfs filesystem?

Best Regards
Wang Yugui ([email protected])
2023/01/11

#1 lore raw
Quoted 11 lines · Wang Yugui

Hi,

question about copy_file_range() between btrfs filesystem.

test progam:
attachment file(copy directly from 'man copy_file_range')

test result:
kernel: 6.1.4
1)in/out files in single btrfs subvol: OK

Quoted 6 lines

2)in/out files in single btrfs filesystem, but different subvols: OK

3)in/out files in different btrfs filesystems: ERROR Invalid cross-device link
but as a compare, in/out files in different nfs filesystems(in same server): OK.
Question:
Should we support copy_file_range() between btrfs filesystem?

I think NFS has some fallback if the source and target files are not on the same underlying filesystem. There's and article about the semantics of copy_file_range https://lwn.net/Articles/846403/ .