public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* btrfs fallocate woes
@ 2010-01-14 11:28 Paul Komkoff
  2010-01-14 17:27 ` Roland Dreier
  0 siblings, 1 reply; 10+ messages in thread
From: Paul Komkoff @ 2010-01-14 11:28 UTC (permalink / raw)
  To: linux-btrfs

Oh hai

Sorry if it's already fixed, but at least in fedora's
2.6.32.3-10.fc12.i686.PAE btrfs has a regression which can be
illustrated by running the following dumb test:

=== cut here ===
#define _GNU_SOURCE
#define _FILE_OFFSET_BITS 64
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

int main() {
  int fd = open("testfile", O_CLOEXEC | O_CREAT | O_NOATIME | O_WRONLY, 0666);

  fallocate(fd, 0, 0, 100);

  write(fd, "test", 4);

  close(fd);
}
=== cut here ===

if you run it on ext4, it will create a 4-byte file with "test" in it.
On btrfs, however, the file size would be 4096, and the remaining
space will be filled with zeroes.

I will try more recent kernels with that though.
-- 
This message represents the official view of the voices in my head

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

end of thread, other threads:[~2010-01-20 15:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-14 11:28 btrfs fallocate woes Paul Komkoff
2010-01-14 17:27 ` Roland Dreier
2010-01-14 18:24   ` Paul Komkoff
2010-01-14 18:25     ` Paul Komkoff
2010-01-14 18:26   ` Aneesh Kumar K. V
2010-01-14 19:20   ` Chris Mason
2010-01-14 20:33     ` Paul Komkoff
2010-01-19 15:18       ` Paul Komkoff
2010-01-20  7:28         ` Aneesh Kumar K. V
2010-01-20 15:13           ` Paul Komkoff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox