Btrfs send does not preserve reflinked files within subvolumes.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm having a hard time getting btrfs receive to create reflinked files
and have a trivial example that I believe *should* work but doesn't.
I've attached a script that I used to perform this test, so others can
try to reproduce.  The text file is the output of the shell script
except the last command, which is a tool I wrote to print the extent
info from FIEMAP.  "btrfs fi du" would work just as well, but I'm on
Ubuntu 16.04, whose btrfs progs doesn't have that command yet.  I've
also tested on Ubuntu 16.10 with similar results, except that "btrfs fi
du" is on that version and confirms what my tool displays.

So, can send not do what I'm trying to get it to do? If it can now,
when did that feature get introduced (must have been after kernel
4.8)?  I'm very surprised that this feature wouldn't have already
been done and if not that no one seems to be complaining about it. I've
done a decent amount of searching on this and have come up with
nothing.  Any help would be greatly appreciated.

Thanks,
Glenn

Attachment: sending-reflinked-files.sh
Description: application/shellscript

+ BVOL1=/media/tmp1
+ BVOL2=/media/tmp2
+ uname -a
Linux crass-Ideapad-Z570 4.4.0-53-generic #74-Ubuntu SMP Fri Dec 2 15:59:10 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
+ btrfs --version
btrfs-progs v4.4
+ cd /media/tmp1
+ btrfs sub create C
Create subvolume './C'
+ dd if=/dev/urandom of=C/test count=100
100+0 records in
100+0 records out
51200 bytes (51 kB, 50 KiB) copied, 0.00485396 s, 10.5 MB/s
+ cp --reflink=always -vp C/test C/test.ref
'C/test' -> 'C/test.ref'
+ btrfs property set C ro true
+ btrfs send -v C
+ btrfs receive /media/tmp2
At subvol C
BTRFS_IOC_SEND returned 0
joining genl thread
At subvol C
+ ~/development/reflink_tools.git/fmaptool.py print -P C/test C/test.ref /media/tmp2/C/test /media/tmp2/C/test.ref
C/test
------
0+53248: 12845056
C/test.ref
----------
0+53248: 12845056
/media/tmp2/C/test
------------------
0+49152: NULL
49152+4096: 12845056
/media/tmp2/C/test.ref
----------------------
0+49152: NULL
49152+4096: 12849152

[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux