Btrfs: fix fallocate regression
authorJosef Bacik <josef@redhat.com>
Mon, 7 Jun 2010 18:26:37 +0000 (18:26 +0000)
committerChris Mason <chris.mason@oracle.com>
Fri, 11 Jun 2010 15:46:12 +0000 (11:46 -0400)
Seems that when btrfs_fallocate was converted to use the new ENOSPC stuff we
dropped passing the mode to the function that actually does the preallocation.
This breaks anybody who wants to use FALLOC_FL_KEEP_SIZE.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/inode.c

index 2551b80183998aeebaffab5a72b477b6212921be..d999c538cdc24a7c7bc60db7b2faadbaeb4719dd 100644 (file)
@@ -6893,7 +6893,7 @@ static long btrfs_fallocate(struct inode *inode, int mode,
                if (em->block_start == EXTENT_MAP_HOLE ||
                    (cur_offset >= inode->i_size &&
                     !test_bit(EXTENT_FLAG_PREALLOC, &em->flags))) {
-                       ret = btrfs_prealloc_file_range(inode, 0, cur_offset,
+                       ret = btrfs_prealloc_file_range(inode, mode, cur_offset,
                                                        last_byte - cur_offset,
                                                        1 << inode->i_blkbits,
                                                        offset + len,