mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@kernel.org>
To: <axboe@kernel.dk>, <hch@lst.de>, <sagi@grimberg.me>,
	<linux-nvme@lists.infradead.org>, <shao.mingyin@zte.com.cn>
Cc: <linux-kernel@vger.kernel.org>, <stable@vger.kernel.org>
Subject: Re: [PATCH] nvmet: fix the CSTS state iteration in debugfs
Date: Fri, 20 Nov 2026 11:54:24 -0800	[thread overview]
Message-ID: <179520446474.200156.8716970202832870904.b4-ty@kernel.org> (raw)
In-Reply-To: <20261115012806699yIujDZo6TywlxuhhSIktO@zte.com.cn>

On Sun, 15 Nov 2026 01:28:06 +0800 (CST), shao.mingyin@zte.com.cn wrote:
> nvmet_ctrl_state_show() uses the size of a sparse name array as a
> bit count.  Its last index is NVME_CSTS_PP (BIT(5)), so the loop has
> 33 iterations and evaluates BIT(32).  This exceeds the width of an
> unsigned long on 32-bit systems.  With GCC on x86 this can make a
> normal ready status print "ready|ready".
> 
> Iterate over the 32 bits of csts instead.  Check the name array bounds
> before indexing it and print unknown bits as unsigned values.  The
> out-of-bounds lookup requires a reserved status bit; the current target
> code does not set those bits.
> 
> [...]

Thanks, applied to nvme-7.4.

[1/1] nvmet: fix the CSTS state iteration in debugfs
      commit: fedfd360c2f6e00d7c566ee5ed52e2ee46c99b8d
--
Keith Busch <kbusch@kernel.org>


      parent reply	other threads:[~2026-11-20 19:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-14 17:28 shao.mingyin
2026-11-20 17:44 ` Christoph Hellwig
2026-11-20 19:54 ` Keith Busch [this message]

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=179520446474.200156.8716970202832870904.b4-ty@kernel.org \
    --to=kbusch@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    --cc=shao.mingyin@zte.com.cn \
    --cc=stable@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

all inboxes | Powered by JetHome®