]> git.baikalelectronics.ru Git - kernel.git/commit
dm: retain table limits when swapping to new table with no devices
authorMike Snitzer <snitzer@redhat.com>
Wed, 26 Sep 2012 22:45:45 +0000 (23:45 +0100)
committerAlasdair G Kergon <agk@redhat.com>
Wed, 26 Sep 2012 22:45:45 +0000 (23:45 +0100)
commit25d4afbbf318475cf37d55d866732fc6c3ea2bca
tree681ff02fc4687617e9293ac3c28919ec26f225b0
parentcab4d8708e4d6e5ab140bf7ffdfb8a56e29b3b67
dm: retain table limits when swapping to new table with no devices

Add a safety net that will re-use the DM device's existing limits in the
event that DM device has a temporary table that doesn't have any
component devices.  This is to reduce the chance that requests not
respecting the hardware limits will reach the device.

DM recalculates queue limits based only on devices which currently exist
in the table.  This creates a problem in the event all devices are
temporarily removed such as all paths being lost in multipath.  DM will
reset the limits to the maximum permissible, which can then assemble
requests which exceed the limits of the paths when the paths are
restored.  The request will fail the blk_rq_check_limits() test when
sent to a path with lower limits, and will be retried without end by
multipath.  This became a much bigger issue after v3.6 commit 624a9852a
("block: do not artificially constrain max_sectors for stacking
drivers").

Reported-by: David Jeffery <djeffery@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
drivers/md/dm-table.c
drivers/md/dm.c
drivers/md/dm.h