From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out28-82.mail.aliyun.com (out28-82.mail.aliyun.com [115.124.28.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 39AE22D29C7 for ; Thu, 7 May 2026 17:10:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.28.82 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778173838; cv=none; b=tLHZKnEcRp22BtqBOcGPAxZ9exdFHgkdhO4Lx5dRjH9MBCsyUVeqfm6JpRd04PQHIm0cywEzCKzyJ5i17IL9XgcmqBrw4I9F/ZDc6mBf43IJPjOlVJeEVEv7/tZIOjOKCeEVK4zb2Lc6yHR4+VSLmx7M20/XIWOjPLWb5ug8Bmc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778173838; c=relaxed/simple; bh=/ATi7dx+SaauKuL7I9IONUnGy2ZPRyCLATtE8TI1xcY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=ERHjJnY4t6bc0g0B5Gsbq/STpNk5c5wuGcn/kbsdpe6Vgn2A2ICSf6u1WwDX61/ZLYiz/g90usGoDxT/FWYJHOHAiUPP/Q+6PUwVJ5160JN8uwe2EFTvo0SD++x6JeNtXIJlnvE1kVZpFsKfFDixYEIADUmgMRJrIUf5Yd1qS9o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=alancui.cc; spf=pass smtp.mailfrom=alancui.cc; dkim=pass (2048-bit key) header.d=alancui.cc header.i=@alancui.cc header.b=gTX5INms; arc=none smtp.client-ip=115.124.28.82 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=alancui.cc Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alancui.cc Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alancui.cc header.i=@alancui.cc header.b="gTX5INms" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=alancui.cc; s=default; t=1778173834; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; bh=MapS9nyYtwgzKpi2my6D51Q4DjgyPby4G0IFSZWdF84=; b=gTX5INms1HAB9PDpeowSERT/tBW4GXQYbr8126UNZ5RyMENBgSV8ojRrfZPwzRzSn9YcwWliFwfvVWIuta8mhu3tir6TB4CykcrNAnEFPdXnPxhzwwRjrwgla5tCyXwNZRzVBdNKYPHRuc8A+7XEbsZWGIEGQhXAR+NVVHVDSUTQrZb8fBxXXofSp2lkBLxcgEAd9tjFM2Yownrm+1KyycnxMTi03D2EkNsJlegogvExD+As0EwLaw+Is9o/jMDWw6NVd6tjbPMJ9l9WA36sUUZ6s3y+8xqDPikRzwWc6WuzAi5001HGakpomJsgYwtP9kC0QitwAKhmsZeJQlxjZA== X-Alimail-AntiSpam:AC=CONTINUE;BC=0.5305654|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_alarm|0.0151987-0.00177872-0.983023;FP=3775383492054609555|0|0|0|0|-1|-1|-1;HT=maildocker-contentspam033037071049;MF=me@alancui.cc;NM=1;PH=DS;RN=3;RT=3;SR=0;TI=SMTPD_---.hRqRX87_1778171979; Received: from alanarchdesktop.localnet(mailfrom:me@alancui.cc fp:SMTPD_---.hRqRX87_1778171979 cluster:ay29) by smtp.aliyun-inc.com; Fri, 08 May 2026 00:39:39 +0800 From: AlanCui4080 To: linux-nvme@lists.infradead.org, Keith Busch Cc: linux-kernel@vger.kernel.org Subject: [PATCH] nvme: make providing NGUID as UUID usage less scary Date: Fri, 08 May 2026 00:36:50 +0800 Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" Hi, > From: Keith Busch > > The warning is a bit alarming, and it only prints for the very first > non-sgl capable device that receives a passthrough command. Just log an > informational message on initial discovery for every device. Since we decide to show this warning at device initial discovery stage, here are some similar warnings that I think are essentially the same. grep -C3 -rn "dev_warn_once" ./drivers/nvme/* ``` ./drivers/nvme/host/sysfs.c-147- * we have no UUID set ./drivers/nvme/host/sysfs.c-148- */ ./drivers/nvme/host/sysfs.c-149- if (uuid_is_null(&ids->uuid)) { ./drivers/nvme/host/sysfs.c:150: dev_warn_once(dev, ./drivers/nvme/host/sysfs.c-151- "No UUID available providing old NGUID\n"); ./drivers/nvme/host/sysfs.c-152- return sysfs_emit(buf, "%pU\n", ids->nguid); ./drivers/nvme/host/sysfs.c-153- } ``` This warning will only complain for the first partition of the first device also. And for NVMe devices, according to the NVM-Express-1_4 specification p.175 Figure 251: "Bit 9 (UUID List): ...", UUID is not mandatory i guess. So let's degrade it into a informational message on initial discovery for every device. Signed-off-by: Alan Cui --- diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 3fdcd73b9546..c432d8bc7b62 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -4296,6 +4296,10 @@ static void nvme_validate_ns(struct nvme_ns *ns, struct nvme_ns_info *info) goto out; } + if (uuid_is_null(&info->ids.uuid)) { + dev_info(ns->ctrl->device, "No UUID available, uuid_show providing old NGUID\n"); + } + ret = nvme_update_ns_info(ns, info); out: /* diff --git a/drivers/nvme/host/sysfs.c b/drivers/nvme/host/sysfs.c index 29430949ce2f..839a36c22ebf 100644 --- a/drivers/nvme/host/sysfs.c +++ b/drivers/nvme/host/sysfs.c @@ -147,8 +147,6 @@ static ssize_t uuid_show(struct device *dev, struct device_attribute *attr, * we have no UUID set */ if (uuid_is_null(&ids->uuid)) { - dev_warn_once(dev, - "No UUID available providing old NGUID\n"); return sysfs_emit(buf, "%pU\n", ids->nguid); } return sysfs_emit(buf, "%pU\n", &ids->uuid); -- 2.54.0