All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jim Ursetto <jim@3e8.org>
To: linux-btrfs@vger.kernel.org
Subject: reflinked file size incorrect
Date: Sat, 12 Jun 2010 11:48:48 -0500	[thread overview]
Message-ID: <20100612164848.GB16863@3e8.org> (raw)

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

             reply	other threads:[~2010-06-12 16:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-12 16:48 Jim Ursetto [this message]
2010-06-12 22:41 ` reflinked file size incorrect Sage Weil
2010-06-13  3:56   ` Jim Ursetto

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=20100612164848.GB16863@3e8.org \
    --to=jim@3e8.org \
    --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.