Btrfs: btrfs_submit_direct_hook: Handle map_length < bio vector length
authorChandan Rajendra <chandan@linux.vnet.ibm.com>
Thu, 21 Jan 2016 10:26:00 +0000 (15:56 +0530)
committerDavid Sterba <dsterba@suse.com>
Mon, 1 Feb 2016 18:24:29 +0000 (19:24 +0100)
commit5f4dc8fc835bbb902f5c2aa3de3978f3f518aa73
tree8ea4c13c613e02a98a17271197790266ea6286bc
parent298cfd368364912076fd84fbceb0df864da42a67
Btrfs: btrfs_submit_direct_hook: Handle map_length < bio vector length

In subpagesize-blocksize scenario, map_length can be less than the length of a
bio vector. Such a condition may cause btrfs_submit_direct_hook() to submit a
zero length bio. Fix this by comparing map_length against block size rather
than with bv_len.

Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c