dm mpath: avoid that path removal can trigger an infinite loop
authorBart Van Assche <bart.vanassche@sandisk.com>
Thu, 27 Apr 2017 17:11:15 +0000 (10:11 -0700)
committerMike Snitzer <snitzer@redhat.com>
Thu, 27 Apr 2017 21:04:27 +0000 (17:04 -0400)
commit7083abbbfc4fa706ff72d27d33a5214881979336
tree2fa2f90642cc55502a2f827620d6fd60a6f3e589
parent89bfce763e43fa4897e0d3af6b29ed909df64cfd
dm mpath: avoid that path removal can trigger an infinite loop

If blk_get_request() fails, check whether the failure is due to a path
being removed.  If that is the case, fail the path by triggering a call
to fail_path().  This avoids that the following scenario can be
encountered while removing paths:
* CPU usage of a kworker thread jumps to 100%.
* Removing the DM device becomes impossible.

Delay requeueing if blk_get_request() returns -EBUSY or -EWOULDBLOCK,
and the queue is not dying, because in these cases immediate requeuing
is inappropriate.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-mpath.c