[PATCH] nvmet: reject invalid write-protect feature values

sashiko-bot at kernel.org sashiko-bot at kernel.org
Mon Nov 9 06:11:18 PST 2026


Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] nvmet: missing Fixes trailer for nvmet_set_feat_write_protect()
  regression
--

commit a435e948ad0b0443cd38d58e0a87dcc11c315ea6
Author: Sreeraj S Kurup <sreekuttan2156239 at gmail.com>

> nvmet: reject invalid write-protect feature values
>
> The Set Features handler for namespace write protection currently
> accepts unsupported values. The default case in the write-protect
> switch leaves the status unchanged, causing the command to return
> success even though no valid setting was applied.
>
> Return NVME_SC_INVALID_FIELD | NVME_STATUS_DNR for unsupported
> values. This also prevents issuing a namespace-change notification
> for an invalid request.
>
> Signed-off-by: Sreeraj S Kurup <sreekuttan2156239 at gmail.com>

[Severity: Low]
Commit 3a1f7c79ae6d ("nvmet: make nvmet_find_namespace() req based") removed
the initial error status assignment in nvmet_set_feat_write_protect(),
leaving status set to 0 after nvmet_req_find_ns() succeeds.  Should this
include:

  Fixes: 3a1f7c79ae6d ("nvmet: make nvmet_find_namespace() req based")

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261109135536.2772-1-sreekuttan2156239@gmail.com?part=1



More information about the Linux-nvme mailing list