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@xxxxxxxxxx>
---
fs/btrfs/relocation.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index ce459a7..fb5752a 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -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);
--
1.7.12.4
--
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