]> git.baikalelectronics.ru Git - kernel.git/commit
dm log: fix unitialized bio operation flags
authorHeinz Mauelshagen <heinzm@redhat.com>
Tue, 23 Aug 2016 19:17:48 +0000 (21:17 +0200)
committerMike Snitzer <snitzer@redhat.com>
Thu, 25 Aug 2016 01:55:05 +0000 (21:55 -0400)
commit500af688ac31bc0510154500ab33dce9b45cf79e
treeb6aa2f9694d9f176afcf5a2116a62f29b4680b0e
parentbec1b7425dc37b106890ddb4266b34fb1590161a
dm log: fix unitialized bio operation flags

Commit 1fb45fccf9 ("dm: use bio op accessors") switched DM over to
using bio_set_op_attrs() but didn't take care to initialize
lc->io_req.bi_op_flags in dm-log.c:rw_header().  This caused
rw_header()'s call to dm_io() to make bio->bi_op_flags be uninitialized
in dm-io.c:do_region(), which ultimately resulted in a SCSI BUG() in
sd_init_command().

Also, adjust rw_header() and its callers to use REQ_OP_{READ|WRITE}.

Fixes: 1fb45fccf9 ("dm: use bio op accessors")
Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@seagate.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-log.c