scsi_dh_rdac: avoid possible deadlock in queue_mode_select
PATCH v2 1/1 scsi_dh_rdac: avoid possible deadlock in queue_mode_select
From: Babu Moger <[email protected]>
Use GFP_NOIO when allocating memory during activation of a new path to avoid possiblility of triggering recursive writeback to a failed path.
A failed IO could cause the path to go down, then we would call queue_mode_select() to active a new path. Allocating memory using GFP_KERNEL is bad to use here because completing the allocation may require the system to write out pages to the same disk that just had the failed path.
Signed-off-by Babu Moger <[email protected]>
Signed-off-by Mike Snitzer <[email protected]>
--- drivers/scsi/device_handler/scsi_dh_rdac.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
v2: just refreshed and tweaked the patch header
- v1 is available here: https://patchwork.kernel.org/patch/71073/
drivers/scsi/device_handler/scsi_dh_rdac.c +1 -1
@@ -625,7 +625,7 @@ static int queue_mode_select(struct scsi_device *sdev,struct rdac_queue_data *qdata;struct rdac_controller *ctlr; - qdata =kzalloc (sizeof (*qdata),GFP_KERNEL ); + qdata =kzalloc (sizeof (*qdata),GFP_NOIO );if (!qdata)return SCSI_DH_RETRY ;