@@ -3244,7 +3244,7 @@ static long btrfs_fallocate(struct file *file, int mode,
u64 locked_end;
u64 actual_end = 0;
struct extent_map *em;
- int blocksize = btrfs_inode_sectorsize(inode);
+ int blocksize = PAGE_SIZE;
int ret;
alloc_start = round_down(offset, blocksize);
@@ -3401,7 +3401,7 @@ static long btrfs_fallocate(struct file *file, int mode,
if (!ret)
ret = btrfs_prealloc_file_range(inode, mode,
range->start,
- range->len, i_blocksize(inode),
+ range->len, blocksize,
offset + len, &alloc_hint);
else
btrfs_free_reserved_data_space(BTRFS_I(inode),
In theory, we can still allow subpage sector size to be utilized in such case, but since btrfs_truncate_block() now operates in page unit, we should also change btrfs_fallocate() to honor PAGE_SIZE as blocksize. Signed-off-by: Qu Wenruo <wqu@suse.com> --- fs/btrfs/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)