From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.116 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794170900; b=nmF2fw2BHgauIHm8+sVXK3w3HyvPwMkHV76AQrN5293MozaATUpzncnz+fC6W+qo+Qdl QkfTVHgrWcnvq4t5jpvl6/ulH8Z0z+e48Lz++ym2/zpKOx/Z7f0JHsM1IIqguO4jkiEhv GB8+uOl04UnqnVBVJfJr/3aC8twbTLSWAAyhT8hmJhhmYXYT8uCFNjaoT1qUwJntUGJ9Z skHRjqFY0Re48AAbKO/NtHTJbHaC2mqCeca7BPLQCknOmd7Z5iGcfiy1pYhOFXxNCG2m0 h6xiuPF0pkPh3wJD+K0hMKkl15tusmhLvcHVBQcNpo2eQNsWHheBPJH2EGRNPu/Xp3Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794170900; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:From:To:Cc:Subject:Date:Message-ID: X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=Hx91sDACoJ7abAEOBHgQJI8JsvMH0QoUw+b4k5ePTNA=; b=1hHBVtgPsebHANlvQjbw+DTDMRhrmolvqLjfVMn5+JKfGpEl9vip2LqY5YzlYuffKwQ2 XrXh6G23r329x44cYbHItybWZXqAYZ9xPc9zpbyZrP8eetSthykUhmA7dN4y4zK61snit VXcDrzSajyQjAS8cB1oEPCLT7lrxPtE6k5tyXHqHHaOH8fuV9Bqc+5Nww0StsHKHY3Wsb 7VTM2ueLQ0SCqFoF54qs5H4BbKSZ507+XKM3YYOR3dRoqxRgHHnZH3bCQKcZFVydRxBI3 HSVXg8AdKulW/BjWMpnnOh9XWTY0iRY4q7DigBewjkqcsdNatHH3EyuohZEgljdVQ9g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=CENeaFWz; arc=none smtp.remote-ip=95.215.58.116 Received: from mta1.migadu.com (out-116.mta1.migadu.com [95.215.58.116]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 09033606A32A for ; Sun, 8 Nov 2026 20:48:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 09033606A32A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=CENeaFWz X-Envelope-To: linux-scsi@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=9d0oDkXwv97bvGSfI+N7Mhx767pQo6f0Hyy+dkcnP7c=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1794170898; v=1; x=1794775698; b=CENeaFWz7VxpzbrU1DAKXWhTzDiaftiZeLA5RF7qqWvYfDUgJb5y0A4GgEp+eh2+k5P8eUO2 TwGPy2L6zHGFn9FdJBw3WzNFFOzX0QSJyBwYO/Y8r3qAruL0mZ/cQvd2+k3kZslCE1418SlWCoR x5QyaghTmlSp0koGvoNZHDo4= X-Envelope-To: linux-scsi@vger.kernel.org Received: by mta10.migadu.com with ESMTPS id 83e0669b2846038b; Sun, 08 Nov 2026 20:48:18 +0000 X-Mizu-Trace-ID: 83e0669b2846038b X-Migadu-Flow: FLOW_OUT From: John Garry To: james.bottomley@hansenpartnership.com, mkp@kernel.org Cc: hare@suse.com, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, snitzer@kernel.org, jmeneghi@redhat.com, bmarzins@redhat.com, dm-devel@lists.linux.dev, hch@lst.de, michael.christie@oracle.com, John Garry Subject: [PATCH v9 18/29] scsi-multipath: revalidate paths upon device unblock Date: Sun, 8 Nov 2026 20:47:22 +0000 Message-ID: <20261108204733.557995-19-john.garry@linux.dev> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261108204733.557995-1-john.garry@linux.dev> References: <20261108204733.557995-1-john.garry@linux.dev> X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit When a scsi_device is unblocked, we need revalidate paths which means that we clear paths and requeue any queued bios. Signed-off-by: John Garry --- drivers/scsi/scsi_lib.c | 2 ++ drivers/scsi/scsi_multipath.c | 8 ++++++++ include/scsi/scsi_multipath.h | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 1950034f580f..4dbd01484b4a 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -3121,6 +3121,8 @@ static int scsi_internal_device_unblock(struct scsi_device *sdev, mutex_lock(&sdev->state_mutex); ret = scsi_internal_device_unblock_nowait(sdev, new_state); mutex_unlock(&sdev->state_mutex); + if ((ret == 0) && sdev->scsi_mpath_dev) + scsi_mpath_revalidate_paths(sdev->scsi_mpath_dev); return ret; } diff --git a/drivers/scsi/scsi_multipath.c b/drivers/scsi/scsi_multipath.c index 67e9010d5478..008bcafe73ad 100644 --- a/drivers/scsi/scsi_multipath.c +++ b/drivers/scsi/scsi_multipath.c @@ -240,6 +240,14 @@ static int scsi_multipath_sdev_init(struct scsi_device *sdev) return 0; } +void scsi_mpath_revalidate_paths(struct scsi_mpath_device *scsi_mpath_dev) +{ + struct scsi_mpath_head *scsi_mpath_head = scsi_mpath_dev->scsi_mpath_head; + struct mpath_head *mpath_head = &scsi_mpath_head->mpath_head; + + mpath_revalidate_paths(mpath_head); +} + void scsi_mpath_dev_clear_path(struct scsi_mpath_device *scsi_mpath_dev) { struct mpath_device *mpath_device = &scsi_mpath_dev->mpath_device; diff --git a/include/scsi/scsi_multipath.h b/include/scsi/scsi_multipath.h index 2064a3e92274..6e50da94fc5d 100644 --- a/include/scsi/scsi_multipath.h +++ b/include/scsi/scsi_multipath.h @@ -56,6 +56,7 @@ void scsi_mpath_put_head(struct scsi_mpath_head *scsi_mpath_head); void scsi_mpath_add_sysfs_link(struct scsi_device *sdev); void scsi_mpath_remove_sysfs_link(struct scsi_device *sdev); void scsi_mpath_dev_clear_path(struct scsi_mpath_device *scsi_mpath_dev); +void scsi_mpath_revalidate_paths(struct scsi_mpath_device *scsi_mpath_dev); #else /* CONFIG_SCSI_MULTIPATH */ struct scsi_mpath_head { @@ -104,5 +105,9 @@ static inline void scsi_mpath_dev_clear_path(struct scsi_mpath_device *scsi_mpath_dev) { } +static inline +void scsi_mpath_revalidate_paths(struct scsi_mpath_device *scsi_mpath_dev) +{ +} #endif /* CONFIG_SCSI_MULTIPATH */ #endif /* _SCSI_SCSI_MULTIPATH_H */ -- 2.43.0