From c0c97b0b75390c7de02f361ef0e0178a04f3c62c Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Fri, 18 Apr 2014 10:43:35 -0400 Subject: [PATCH] add patch use-filemap_write_and_wait_range-correctly-in-collapse_range --- series | 1 + ...rite_and_wait_range-correctly-in-collapse_range | 38 ++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 use-filemap_write_and_wait_range-correctly-in-collapse_range diff --git a/series b/series index 9bf3de17..aeea58bb 100644 --- a/series +++ b/series @@ -23,6 +23,7 @@ add-fallocate-mode-blocking-for-debugging fix-ext4_count_free_clusters-with-bigalloc remove-COLLAPSE_RANGE-and-ZERO-RANGE-shim use-truncate_pagecache-in-collapse_range +use-filemap_write_and_wait_range-correctly-in-collapse_range # ^^^ above are to be pushed to Linus for 3.15-rc1 diff --git a/use-filemap_write_and_wait_range-correctly-in-collapse_range b/use-filemap_write_and_wait_range-correctly-in-collapse_range new file mode 100644 index 00000000..b44d4e88 --- /dev/null +++ b/use-filemap_write_and_wait_range-correctly-in-collapse_range @@ -0,0 +1,38 @@ +ext4: use filemap_write_and_wait_range() correctly in collapse range + +From: Lukas Czerner + +Currently we're passing -1 as lend argumnet for +filemap_write_and_wait_range() which is wrong since lend is signed type +so it would cause some confusion and we might not write_and_wait for the +entire range we're expecting to write. + +Fix it by using LLONG_MAX instead. + +Signed-off-by: Lukas Czerner +Signed-off-by: "Theodore Ts'o" +--- + fs/ext4/extents.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c +index ff823b7..821c1d4 100644 +--- a/fs/ext4/extents.c ++++ b/fs/ext4/extents.c +@@ -5378,7 +5378,7 @@ int ext4_collapse_range(struct inode *inode, loff_t offset, loff_t len) + punch_stop = (offset + len) >> EXT4_BLOCK_SIZE_BITS(sb); + + /* Write out all dirty pages */ +- ret = filemap_write_and_wait_range(inode->i_mapping, offset, -1); ++ ret = filemap_write_and_wait_range(inode->i_mapping, offset, LLONG_MAX); + if (ret) + return ret; + +-- +1.8.3.1 + +-- +To unsubscribe from this list: send the line "unsubscribe linux-ext4" in +the body of a message to majordomo@vger.kernel.org +More majordomo info at http://vger.kernel.org/majordomo-info.html + -- 2.11.4.GIT