]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: raid56: iterate raid56 internal bio with bio_for_each_segment_all
authorLiu Bo <bo.li.liu@oracle.com>
Sat, 13 Jan 2018 01:07:01 +0000 (18:07 -0700)
committerDavid Sterba <dsterba@suse.com>
Mon, 22 Jan 2018 15:08:21 +0000 (16:08 +0100)
commitae2765274db091c6b0c79177ffcb1c927c526c9e
treee386e24dd253ae29cf4d363b6e105f9da731018b
parentcdb8e9a7d486af0ffd3d3ad555c7cbb40106b63a
Btrfs: raid56: iterate raid56 internal bio with bio_for_each_segment_all

Bio iterated by set_bio_pages_uptodate() is raid56 internal one, so it
will never be a BIO_CLONED bio, and since this is called by end_io
functions, bio->bi_iter.bi_size is zero, we mustn't use
bio_for_each_segment() as that is a no-op if bi_size is zero.

Fixes: 39f0a479d82718cf85b571113fefddaf78be29e6 ("Btrfs: fix write corruption due to bio cloning on raid5/6")
Cc: <stable@vger.kernel.org> # v4.12-rc6+
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/raid56.c