Skip to content

scsi: scsi_dh_alua: use device timeout instead of constant

Brian Bunker linux-scsi 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest0 of 1 patch 0 repliesNew

Changes in v2 from the cover letter

- Added READ_ONCE() when accessing sdev->request_queue->rq_timeout since this value can be modified dynamically by userspace via sysfs
- Added fallback to ALUA_FAILOVER_TIMEOUT if rq_timeout is 0, using the ?: operator, to handle any edge cases where the timeout might be uninitialized (though sysfs store functions reject 0)
- Retained ALUA_FAILOVER_TIMEOUT constant as the fallback value

Patches in v2 No applies recorded yet

The patch the cover letter announces is not in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/1] scsi: scsi_dh_alua: use device timeout instead of constant

This patch changes the ALUA device handler to use the SCSI device's configured timeout (rq_timeout) instead of the hardcoded 60-second ALUA_FAILOVER_TIMEOUT constant. This allows administrators to control ALUA-related timeouts via the standard SCSI device timeout sysfs interface (/sys/block/sdX/device/timeout).

Changes in v2:
- Added READ_ONCE() when accessing sdev->request_queue->rq_timeout since this value can be modified dynamically by userspace via sysfs
- Added fallback to ALUA_FAILOVER_TIMEOUT if rq_timeout is 0, using the ?: operator, to handle any edge cases where the timeout might be uninitialized (though sysfs store functions reject 0)
- Retained ALUA_FAILOVER_TIMEOUT constant as the fallback value

Regarding dynamic changes to rq_timeout: this is acceptable because each SCSI command reads the current timeout when issued. If an admin changes the timeout mid-operation, subsequent commands will use the new value. This is actually desirable as it allows administrators to adjust timeouts on the fly during problematic failovers without reloading modules.

Brian Bunker (1):
scsi: scsi_dh_alua: use the device timeout rather than a constant

 drivers/scsi/device_handler/scsi_dh_alua.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
Signature · 1 line
2.50.1 (Apple Git-155)