linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bug: trying to create reflink on different device results in empty file
@ 2012-12-11 22:16 Koen De Wit
  2012-12-19 16:04 ` David Sterba
  0 siblings, 1 reply; 2+ messages in thread
From: Koen De Wit @ 2012-12-11 22:16 UTC (permalink / raw)
  To: linux-btrfs

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-12-19 16:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-11 22:16 Bug: trying to create reflink on different device results in empty file Koen De Wit
2012-12-19 16:04 ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).