From: Fan Li Date: Mon, 14 Dec 2015 05:34:00 +0000 (+0800) Subject: f2fs: write only the pages in range during defragment X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=d8fe4f0e74cb27e79b2b500ca6eae9f9b02748b4;p=openwrt%2Fstaging%2Fblogic.git f2fs: write only the pages in range during defragment @lend of filemap_write_and_wait_range is supposed to be a "offset in bytes where the range ends (inclusive)". Subtract 1 to avoid writing an extra page. Signed-off-by: Fan li Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 294e71576cec..5fac4f259965 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -1686,7 +1686,7 @@ static int f2fs_defragment_range(struct f2fs_sb_info *sbi, /* writeback all dirty pages in the range */ err = filemap_write_and_wait_range(inode->i_mapping, range->start, - range->start + range->len); + range->start + range->len - 1); if (err) goto out;