Both `cp --reflink` and `bcp` sometimes round the file size up to the next
4k boundary, with the balance consisting of null bytes. At first glance
this behavior occurs for source file size > 3916 bytes. I have tried this
with stock btrfs from kernel 2.6.35-rc2 and 2.6.35-rc1 -- specifically,
Ubuntu 2.6.35-2.3~lucid1-server and 2.6.35-1.1~lucid1-server.
Any ideas?
$ rm -f abc; dd if=/dev/urandom of=abc bs=1 count=3917; \
cp --reflink abc abc.1; ll abc*
3917 bytes (3.9 kB) copied, 0.0380613 s, 103 kB/s
-rw-r----- 1 root root 3917 2010-06-12 04:22 abc
-rw-r----- 1 root root 4096 2010-06-12 04:22 abc.1
$ rm -f abc; dd if=/dev/urandom of=abc bs=1 count=3916; \
cp --reflink abc abc.1; ll abc*
3916 bytes (3.9 kB) copied, 0.0299729 s, 131 kB/s
-rw-r----- 1 root root 3916 2010-06-12 04:22 abc
-rw-r----- 1 root root 3916 2010-06-12 04:22 abc.1
$ rm -f abc; dd if=/dev/urandom of=abc bs=1 count=4097; \
cp --reflink abc abc.1; ll abc*
4097 bytes (4.1 kB) copied, 0.0258441 s, 159 kB/s
-rw-r----- 1 root root 4097 2010-06-12 11:08 abc
-rw-r----- 1 root root 8192 2010-06-12 11:08 abc.1
$ uname -a
Linux allie 2.6.35-2-server #3~lucid1-Ubuntu SMP Thu Jun 10 17:52:32 UTC 2010
x86_64 GNU/Linux
Jim
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs"
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html