add patch avoid-unneeded-lookup-when-xattr-name-is-invalid
[ext4-patch-queue.git] / use-filemap_write_and_wait_range-correctly-in-collapse_range
blobb44d4e886639c96f92359b1dd6f29c6fe6a99dbd
1 ext4: use filemap_write_and_wait_range() correctly in collapse range
3 From: Lukas Czerner <lczerner@redhat.com>
5 Currently we're passing -1 as lend argumnet for
6 filemap_write_and_wait_range() which is wrong since lend is signed type
7 so it would cause some confusion and we might not write_and_wait for the
8 entire range we're expecting to write.
10 Fix it by using LLONG_MAX instead.
12 Signed-off-by: Lukas Czerner <lczerner@redhat.com>
13 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
14 ---
15  fs/ext4/extents.c | 2 +-
16  1 file changed, 1 insertion(+), 1 deletion(-)
18 diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
19 index ff823b7..821c1d4 100644
20 --- a/fs/ext4/extents.c
21 +++ b/fs/ext4/extents.c
22 @@ -5378,7 +5378,7 @@ int ext4_collapse_range(struct inode *inode, loff_t offset, loff_t len)
23         punch_stop = (offset + len) >> EXT4_BLOCK_SIZE_BITS(sb);
25         /* Write out all dirty pages */
26 -       ret = filemap_write_and_wait_range(inode->i_mapping, offset, -1);
27 +       ret = filemap_write_and_wait_range(inode->i_mapping, offset, LLONG_MAX);
28         if (ret)
29                 return ret;
31 -- 
32 1.8.3.1
35 To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
36 the body of a message to majordomo@vger.kernel.org
37 More majordomo info at  http://vger.kernel.org/majordomo-info.html