cp --reflink with Btrfs
Quoted 11 lines · * Sage Weil ([email protected]) [091216 17:55]:
Quoted 5 lines · Li Dongyang
Have a look at line 998,
ioctl.c, insidebtrfs_ioctl_clone(),
thesrc->i_size(the size of the testfile created by touch)is just 0, and this will causebtrfs_ioctl_clonejust return-EINVAL.
I'm not sure if it makes sense to clone a file which actually doesn't have any data extents.Probably not, but it seems more consistent to return success instead than
-EINVAL. Requiring the caller to check and special case empty files isn't very friendly...
Actually it makes lots of sense if trying to e.g. cow-copy an chroot on an buildd, and there are some empty files inside of the linux installation (which normally just are).
Can I hope on getting the patch (or another patch) incorporated into the kernel?
Cheers,
Andi
Quoted 14 lines · Andreas Barth
Quoted 11 lines · * Sage Weil ([email protected]) [091216 17:55]:
Quoted 5 lines · Li Dongyang
Have a look at line 998,
ioctl.c, insidebtrfs_ioctl_clone(),
thesrc->i_size(the size of the testfile created by touch)is just 0, and this will causebtrfs_ioctl_clonejust return-EINVAL.
I'm not sure if it makes sense to clone a file which actually doesn't have any data extents.Probably not, but it seems more consistent to return success instead than
-EINVAL. Requiring the caller to check and special case empty files isn't very friendly...
Quoted 6 lines
Actually it makes lots of sense if trying to e.g. cow-copy an chroot on an buildd, and there are some empty files inside of the linux installation (which normally just are).
Can I hope on getting the patch (or another patch) incorporated into the kernel?
In this case the application is responsible for duplicating the file. The clone ioctl doesn't actually clone any of the file metadata or anything else.
-chris