public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/1] scsi: scsi_dh_alua: use device timeout instead of constant
@ 2026-03-25 15:15 Brian Bunker
  2026-03-25 15:15 ` [PATCH v2] scsi: scsi_dh_alua: use the device timeout rather than a constant Brian Bunker
  0 siblings, 1 reply; 4+ messages in thread
From: Brian Bunker @ 2026-03-25 15:15 UTC (permalink / raw)
  To: linux-scsi, hare; +Cc: Brian Bunker

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(-)

-- 
2.50.1 (Apple Git-155)


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-03-27  0:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-25 15:15 [PATCH v2 0/1] scsi: scsi_dh_alua: use device timeout instead of constant Brian Bunker
2026-03-25 15:15 ` [PATCH v2] scsi: scsi_dh_alua: use the device timeout rather than a constant Brian Bunker
2026-03-26 10:22   ` Hannes Reinecke
2026-03-27  0:12     ` Brian Bunker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox