From: Koen De Wit <koen.de.wit@oracle.com>
To: linux-btrfs@vger.kernel.org
Subject: Bug: trying to create reflink on different device results in empty file
Date: Tue, 11 Dec 2012 23:16:03 +0100 [thread overview]
Message-ID: <50C7B0A3.7040408@oracle.com> (raw)
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
next reply other threads:[~2012-12-11 22:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-11 22:16 Koen De Wit [this message]
2012-12-19 16:04 ` Bug: trying to create reflink on different device results in empty file David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50C7B0A3.7040408@oracle.com \
--to=koen.de.wit@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.