@@ -4529,7 +4529,6 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans,
int btrfs_truncate_block(struct inode *inode, loff_t from, loff_t len,
int front)
{
- struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
struct address_space *mapping = inode->i_mapping;
struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree;
struct btrfs_ordered_extent *ordered;
@@ -4537,7 +4536,7 @@ int btrfs_truncate_block(struct inode *inode, loff_t from, loff_t len,
struct extent_changeset *data_reserved = NULL;
char *kaddr;
bool only_release_metadata = false;
- u32 blocksize = fs_info->sectorsize;
+ u32 blocksize = PAGE_SIZE;
pgoff_t index = from >> PAGE_SHIFT;
unsigned offset = from & (blocksize - 1);
struct page *page;
This is mostly for subpage write back, as we still can only submit full page write, we can't truncate the subpage sector. Thus here we truncate the whole page other than each sector. Signed-off-by: Qu Wenruo <wqu@suse.com> --- fs/btrfs/inode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)