dm table: fix 'all_blk_mq' inconsistency when an empty table is loaded
authorMike Snitzer <snitzer@redhat.com>
Wed, 23 Nov 2016 18:51:09 +0000 (13:51 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Jan 2017 09:40:15 +0000 (10:40 +0100)
commit470b6910f7c1d492884fc4c741bd1011a8ac4205
treec45863247a82e85ce696945b12d286e3e370a3b7
parent67b0069a5175c14ddcf12c431bcf400ca23f9931
dm table: fix 'all_blk_mq' inconsistency when an empty table is loaded

commit 6936c12cf809850180b24947271b8f068fdb15e9 upstream.

An earlier DM multipath table could have been build ontop of underlying
devices that were all using blk-mq.  In that case, if that active
multipath table is replaced with an empty DM multipath table (that
reflects all paths have failed) then it is important that the
'all_blk_mq' state of the active table is transfered to the new empty DM
table.  Otherwise dm-rq.c:dm_old_prep_tio() will incorrectly clone a
request that isn't needed by the DM multipath target when it is to issue
IO to an underlying blk-mq device.

Fixes: e83068a5 ("dm mpath: add optional "queue_mode" feature")
Reported-by: Bart Van Assche <bart.vanassche@sandisk.com>
Tested-by: Bart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-table.c