When trying to create a clone (reflink) of a file on a different device,
you'll get this error:
Invalid cross-device link
However, an empty file is created on the target location. An invalid
clone operation should not result in the creation of a file.
Example:
# mount
(...)
/dev/sdb1 on /mnt/diskb type btrfs (rw)
/dev/sdf1 on /mnt/diskf type btrfs (rw)
# ls -l diskb
total 4
-rw-r--r-- 1 root root 11 Dec 11 22:45 testfile.txt
# ls -l diskf
total 0
# cp --reflink diskb/testfile.txt diskf/testcopy.txt
cp: failed to clone `diskf/testcopy.txt' from `diskb/testfile.txt':
Invalid cross-device link
# ls -l diskf
total 0
-rw-r--r-- 1 root root 0 Dec 11 22:56 testcopy.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html