@@ -3149,11 +3149,13 @@ static int relocate_file_extent_cluster(struct inode *inode,
set_page_extent_mapped(page);
if (nr < cluster->nr &&
- page_start + offset == cluster->boundary[nr]) {
+ page_start + offset <= cluster->boundary[nr] &&
+ page_end + offset >= cluster->boundary[nr]) {
set_extent_bits(&BTRFS_I(inode)->io_tree,
page_start, page_end,
EXTENT_BOUNDARY, GFP_NOFS);
- nr++;
+ while (page_end + offset < cluster->boundary[nr])
+ nr++;
}
btrfs_set_extent_delalloc(inode, page_start, page_end, NULL);
For relocation clusters boundaries are at blocks, hence in the case of subpagesize-blocksize, we need to make sure the data in the page is handled correctly with the cluster boundary. This patch does that. Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com> --- fs/btrfs/relocation.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)