linux/block
Darrick J. Wong 594416a720 block: fix regression where bio_integrity_process uses wrong bio_vec iterator
bio integrity handling is broken on a system with LVM layered atop a
DIF/DIX SCSI drive because device mapper clones the bio, modifies the
clone, and sends the clone to the lower layers for processing.
However, the clone bio has bi_vcnt == 0, which means that when the sd
driver calls bio_integrity_process to attach DIX data, the
for_each_segment_all() call (which uses bi_vcnt) returns immediately
and random garbage is sent to the disk on a disk write.  The disk of
course returns an error.

Therefore, teach bio_integrity_process() to use bio_for_each_segment()
to iterate the bio_vecs, since the per-bio iterator tracks which
bio_vecs are associated with that particular bio.  The integrity
handling code is effectively part of the "driver" (it's not the bio
owner), so it must use the correct iterator function.

v2: Fix a compiler warning about abandoned local variables.  This
patch supersedes "block: bio_integrity_process uses wrong bio_vec
iterator".  Patch applies against 3.18-rc6.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
2014-12-02 08:15:21 -07:00
..
partitions block: Replace strnicmp with strncasecmp 2014-09-27 16:48:55 -06:00
bio-integrity.c block: fix regression where bio_integrity_process uses wrong bio_vec iterator 2014-12-02 08:15:21 -07:00
bio.c block: add bioset_create_nobvec() 2014-10-03 15:28:18 -06:00
blk-cgroup.c
blk-cgroup.h
blk-core.c Merge branch 'for-3.18/core' of git://git.kernel.dk/linux-block 2014-10-18 11:53:51 -07:00
blk-exec.c
blk-flush.c blk-mq: support per-distpatch_queue flush machinery 2014-09-25 15:22:45 -06:00
blk-integrity.c block: Don't merge requests if integrity flags differ 2014-09-27 09:14:57 -06:00
blk-ioc.c
blk-iopoll.c
blk-lib.c
blk-map.c
blk-merge.c block: blk-merge: fix blk_recount_segments() 2014-11-11 16:24:15 -07:00
blk-mq-cpu.c
blk-mq-cpumap.c
blk-mq-sysfs.c
blk-mq-tag.c blk-mq: Make bt_clear_tag() easier to read 2014-10-07 08:45:21 -06:00
blk-mq-tag.h
blk-mq.c blk-mq: make mq_queue_reinit_notify() freeze queues in parallel 2014-11-04 14:49:31 -07:00
blk-mq.h
blk-settings.c block: fix alignment_offset math that assumes io_min is a power-of-2 2014-10-09 09:41:40 -06:00
blk-softirq.c
blk-sysfs.c Merge branch 'for-3.18/core' of git://git.kernel.dk/linux-block 2014-10-18 11:53:51 -07:00
blk-tag.c
blk-throttle.c
blk-timeout.c
blk.h blk-mq: support per-distpatch_queue flush machinery 2014-09-25 15:22:45 -06:00
bounce.c
bsg-lib.c
bsg.c
cfq-iosched.c
cmdline-parser.c
compat_ioctl.c
deadline-iosched.c
elevator.c block: fix wrong error return in elevator_init() 2014-10-23 12:35:42 -06:00
genhd.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2014-10-07 21:16:26 -04:00
ioctl.c
ioprio.c block: Fix computation of merged request priority 2014-10-31 08:30:43 -06:00
Kconfig block: Add T10 Protection Information functions 2014-09-27 09:14:59 -06:00
Kconfig.iosched
Makefile block: Add T10 Protection Information functions 2014-09-27 09:14:59 -06:00
noop-iosched.c
partition-generic.c
scsi_ioctl.c scsi: Fix more error handling in SCSI_IOCTL_SEND_COMMAND 2014-11-10 15:41:47 -07:00
t10-pi.c block: Add T10 Protection Information functions 2014-09-27 09:14:59 -06:00