Skip to content

Commit

Permalink
Btrfs: fix wrong write range for filemap_fdatawrite_range()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wang Shilong authored and Chris Mason committed Aug 19, 2014
1 parent 3a7d55c commit 9a025a0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
/*
Expand Down

0 comments on commit 9a025a0

Please sign in to comment.