btrfs: avoid accessing bvec table directly for a cloned bio
authorMing Lei <ming.lei@redhat.com>
Mon, 18 Dec 2017 12:22:12 +0000 (20:22 +0800)
committerJens Axboe <axboe@kernel.dk>
Sat, 6 Jan 2018 16:18:00 +0000 (09:18 -0700)
commitc16a8ac3c021f454550f851f5e0772b29a5125b0
tree74e6e1b92ce7244ff5a052a7189b9874981164a0
parenta0b60d725e54f1caba4f5dc0dfef68040bcf9a8e
btrfs: avoid accessing bvec table directly for a cloned bio

Commit 17347cec15f919901c90(Btrfs: change how we iterate bios in endio)
mentioned that for dio the submitted bio may be fast cloned, we
can't access the bvec table directly for a cloned bio, so use
bio_get_first_bvec() to retrieve the 1st bvec.

Cc: Chris Mason <clm@fb.com>
Cc: Josef Bacik <jbacik@fb.com>
Cc: David Sterba <dsterba@suse.com>
Cc: linux-btrfs@vger.kernel.org
Cc: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
Acked: David Sterba <dsterba@suse.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/btrfs/inode.c