public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Bunker <brian@purestorage.com>
To: linux-scsi@vger.kernel.org, hare@suse.com
Cc: Brian Bunker <brian@purestorage.com>
Subject: [PATCH v2 0/1] scsi: scsi_dh_alua: use device timeout instead of constant
Date: Wed, 25 Mar 2026 08:15:14 -0700	[thread overview]
Message-ID: <20260325151515.18688-1-brian@purestorage.com> (raw)

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)


             reply	other threads:[~2026-03-25 15:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-25 15:15 Brian Bunker [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260325151515.18688-1-brian@purestorage.com \
    --to=brian@purestorage.com \
    --cc=hare@suse.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox