Btrfs: fix wrong write range for filemap_fdatawrite_range()
authorWang Shilong <wangsl.fnst@cn.fujitsu.com>
Thu, 17 Jul 2014 03:44:13 +0000 (11:44 +0800)
committerChris Mason <clm@fb.com>
Tue, 19 Aug 2014 15:52:12 +0000 (08:52 -0700)
filemap_fdatawrite_range() expect the third arg to be @end
not @len, fix it.

Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Reviewed-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/inode.c

index 33c05188cbf0cec78d79b1ec865b75347cef3bd9..73fadc7ead0e4bf1805a8cfdd6a88a31f2499373 100644 (file)
@@ -7533,7 +7533,8 @@ static ssize_t btrfs_direct_IO(int rw, struct kiocb *iocb,
        count = iov_iter_count(iter);
        if (test_bit(BTRFS_INODE_HAS_ASYNC_EXTENT,
                     &BTRFS_I(inode)->runtime_flags))
-               filemap_fdatawrite_range(inode->i_mapping, offset, count);
+               filemap_fdatawrite_range(inode->i_mapping, offset,
+                                        offset + count - 1);
 
        if (rw & WRITE) {
                /*