Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796088277; b=HAAMGPqwAWESIpJDHDguVHJmfJec+ZDtvTRKcevNbdMRxXIOqqf8Wz7cgBFUW8ttNoD+ hwsGWku2IjUnNPY5lx1b3vGZcl9vcuDxG+IdbtIN8j1YsNYys+qNy3BN9kkf7ZpeISDyk hn+7szxMMIoYD9TyXsxzpxdVnGfY7XLDtnWJKo2ln3O4sqEU8Dmih1UnbRJoKmuSaVi3B m9fQUygdBQCqrPH2goycX8gO7Ru/E+sML2Tblgq462NmWEvoCH1ZYngKF6jAraqbJQTyJ Vrb4FLho6qenJGQG6ml4s81cQpn1F0uG9zFQtynExLcyvpPFpIce5hrzt3MRgiZ8J4g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796088277; h=DMARC-Filter:DKIM-Signature:X-MC-Rep:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:Received:Received:Received:Date:From: To:Cc:Subject:Message-ID:References:MIME-Version:In-Reply-To: X-Scanned-By:X-Mimecast-Spam-Score:X-Mimecast-MFC-PROC-ID: X-Mimecast-Originator:Content-Type:Content-Disposition; bh=F0ba0ADIdfhm0WKSb/emUdpX3GkNwD5dzsPKrg2gQr4=; b=ciSDW5A1/zalLM/eaS0OvaBt6JaFVklxE0vKcBTf1UZCu36P8hGmlw/m1H0XaU/dU73G 0q8AIqchDpWnIkRdviTqtRHTQvWtQXVw+5bY9Wu+WFjFnaBe1Yv7QS2aENfQdW/JG7NvI oovq4xy05tdljP0BpTVGGV4tVbar98ogoVFbxQuBiuyJ5QbMGoCPTWyRQWWI66K6wnrUe dBHMxstXKhiK70wISIhRvA+dTl8YZpMmiyv0M5qOtOQjUlNQmAo+cSHM7bqG1nRagxkmf R8537NLEifEMjH75G7pKSAp2Q5Gs4T7shTmOB5Runz6KvAiYkRmBLiuUZxjH0l3vXNg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=HtwUdWWC; arc=none smtp.remote-ip=170.10.129.124 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 77E93606A320 for ; Tue, 1 Dec 2026 01:24:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 77E93606A320 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=HtwUdWWC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796088275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=F0ba0ADIdfhm0WKSb/emUdpX3GkNwD5dzsPKrg2gQr4=; b=HtwUdWWCn+6d+7s/UjsTBOrMOeFvNnOfmMVvATNmRdm98rmj+omTFVmzWA8tHSynEStcz4 aXDNdDOV0WsdIHD7V+3/V3qEu0iXuHn+mEli+ZkGyPZ8gFRL+Jq5hFRvQtDHKe4LZwawIQ UZJtc4qHvqkefrk5R5IdIVe/2xA+eF0= X-MC-Rep: binary re single Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-499-XRDULBz-PoiclMsJMiL5Mg-1; Tue, 1 Dec 2026 01:24:29 +0000 X-MC-Unique: XRDULBz-PoiclMsJMiL5Mg-1 X-Mimecast-MFC-AGG-ID: XRDULBz-PoiclMsJMiL5Mg_1796088267 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A8CAF18028B3; Tue, 1 Dec 2026 01:24:27 +0000 (UTC) Received: from bmarzins-01.fast.eng.rdu2.dc.redhat.com (bmarzins-01.fast.eng.rdu2.dc.redhat.com [10.6.23.12]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 4CB41428; Tue, 1 Dec 2026 01:24:27 +0000 (UTC) Received: from bmarzins-01.fast.eng.rdu2.dc.redhat.com (localhost [127.0.0.1]) by bmarzins-01.fast.eng.rdu2.dc.redhat.com (8.18.1/8.17.1) with ESMTPS id 6B11OQ423698864 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 30 Nov 2026 20:24:26 -0500 Received: (from bmarzins@localhost) by bmarzins-01.fast.eng.rdu2.dc.redhat.com (8.18.1/8.18.1/Submit) id 6B11OO243698849; Mon, 30 Nov 2026 20:24:24 -0500 Date: Mon, 30 Nov 2026 20:24:24 -0500 From: Benjamin Marzinski To: Brian Bunker Cc: dm-devel@lists.linux.dev, Martin Wilck , Christophe Varoqui Subject: Re: [PATCH v5 1/1] multipathd: recheck WWIDs of re-added paths with the device Message-ID: References: <20261130202558.28849-1-brian@purestorage.com> <20261130202558.28849-2-brian@purestorage.com> X-Mailing-List: dm-devel@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 In-Reply-To: <20261130202558.28849-2-brian@purestorage.com> X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: nwcrRynuOAuIyptXEhFJvt1ccEmgF1Dg5RrXQ9tv_rs_1796088267 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Nov 30, 2026 at 12:25:58PM -0800, Brian Bunker wrote: > multipathd takes a path's WWID from udev. When a change uevent reports > a different WWID, uev_update_path() removes the path from its map and > re-adds it through uev_add_path(), which places it in whatever map owns > the new WWID. The removal can block for seconds while the map is > suspended, so by the time the path is re-added, the WWID in the uevent > may no longer be what the device reports. If it is wrong, the path goes > into the map of a different LUN and I/O for one LUN is silently sent to > another. > > If recheck_wwid is set and the path is up, confirm the WWID with the > device over SG_IO before such a re-add puts the path into a map, as > recheck_wwid already does when a failed path comes back. If the device > doesn't confirm it, or its WWID can't be read, leave the path out of > the map: orphan it, clear its WWID and mark it INIT_MISSING_UDEV, so > the checker retriggers udev after retrigger_delay and the path is > re-added from fresh data. A path that isn't up is checked by > recheck_wwid once it comes up. > > To tell these re-adds from ordinary adds, turn the need_do_map argument > of uev_add_path() and ev_add_path() into enum path_add_mode, with a new > PATH_ADD_REINIT value that behaves like PATH_ADD_MAP. It is passed only > for the re-add at the end of uev_update_path() after udev reported a > changed WWID. The re-add after a udev retrigger, and ordinary adds, are > unchanged, so udev data obtained by a retrigger is trusted. > > Split check_path_wwid() out of check_path_wwid_change() so that a > failure to read the device's WWID can be told apart from a match. > check_path_wwid_change() still returns true only on a mismatch. > > Document the new case under recheck_wwid in multipath.conf(5). Look pretty good. One minor possible change below. Feel free to tell me I'm trying to abuse path_add_mode. > Signed-off-by: Brian Bunker > --- > multipath/multipath.conf.5.in | 8 ++-- > multipathd/cli_handlers.c | 2 +- > multipathd/main.c | 74 +++++++++++++++++++++++++++-------- > multipathd/main.h | 13 +++++- > 4 files changed, 75 insertions(+), 22 deletions(-) > > diff --git a/multipathd/main.c b/multipathd/main.c > index 9bce4d6b..e32128a3 100644 > --- a/multipathd/main.c > +++ b/multipathd/main.c [...] > @@ -1656,6 +1694,7 @@ uev_update_path (struct uevent *uev, struct vectors * vecs) > struct path * pp; > struct config *conf; > int needs_reinit = 0; > + enum path_add_mode reinit_mode = PATH_ADD_MAP; Since we're tracking the reinit_mode with a path_add_mode enum, it seems to me like needs_reinit is unnecessary. We could just default reinit_mode to PATH_ADD_NO_MAP, and either set it to PATH_ADD_MAP for a INIT_REQUESTED_UDEV path or PATH_ADD_REINIT for a changed wwid path. Then, instead of checking need_reinit at the end of the function, we could just check (reinit_mode != PATH_ADD_NO_MAP). Obviously other callers of uev_add_path() do pass in PATH_ADD_NO_MAP as a mode, so if people think this usage is confusing and not worth removing a redundant variable, that's fine. -Ben