All of lore.kernel.org
 help / color / mirror / Atom feed
* reflinked file size incorrect
@ 2010-06-12 16:48 Jim Ursetto
  2010-06-12 22:41 ` Sage Weil
  0 siblings, 1 reply; 3+ messages in thread
From: Jim Ursetto @ 2010-06-12 16:48 UTC (permalink / raw)
  To: linux-btrfs

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

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

* Re: reflinked file size incorrect
  2010-06-12 16:48 reflinked file size incorrect Jim Ursetto
@ 2010-06-12 22:41 ` Sage Weil
  2010-06-13  3:56   ` Jim Ursetto
  0 siblings, 1 reply; 3+ messages in thread
From: Sage Weil @ 2010-06-12 22:41 UTC (permalink / raw)
  To: Jim Ursetto; +Cc: linux-btrfs

On Sat, 12 Jun 2010, Jim Ursetto wrote:
> 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?

This bug is new in 2.6.35-rc1 from a22285a6 (Btrfs: Integrate metadata 
reservation with start_transaction).  Just sent a patch fixing this up to 
the list.

sage

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

* Re: reflinked file size incorrect
  2010-06-12 22:41 ` Sage Weil
@ 2010-06-13  3:56   ` Jim Ursetto
  0 siblings, 0 replies; 3+ messages in thread
From: Jim Ursetto @ 2010-06-13  3:56 UTC (permalink / raw)
  To: Sage Weil; +Cc: linux-btrfs

At 05:41pm on 2010 June 12, Sage Weil did write:
> This bug is new in 2.6.35-rc1 from a22285a6 (Btrfs: Integrate metadata 
> reservation with start_transaction).  Just sent a patch fixing this up to 
> the list.

Thank you, patch works perfectly.
Jim

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

end of thread, other threads:[~2010-06-13  3:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-12 16:48 reflinked file size incorrect Jim Ursetto
2010-06-12 22:41 ` Sage Weil
2010-06-13  3:56   ` Jim Ursetto

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.