btrfs fallocate woes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux