lkml.org 
[lkml]   [2021]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.11 289/775] nvmet: set status to 0 in case for invalid nsid
    Date
    From: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>

    [ Upstream commit 40244ad36bcfb796a6bb9e95bdcbf8ddf3134509 ]

    For unallocated namespace in nvmet_execute_identify_ns() don't set the
    status to NVME_SC_INVALID_NS, set it to zero.

    Fixes: bffcd507780e ("nvmet: set right status on error in id-ns handler")
    Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/nvme/target/admin-cmd.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/drivers/nvme/target/admin-cmd.c b/drivers/nvme/target/admin-cmd.c
    index de6aaa4c96e53..1827d8d8f3b00 100644
    --- a/drivers/nvme/target/admin-cmd.c
    +++ b/drivers/nvme/target/admin-cmd.c
    @@ -487,7 +487,7 @@ static void nvmet_execute_identify_ns(struct nvmet_req *req)
    /* return an all zeroed buffer if we can't find an active namespace */
    req->ns = nvmet_find_namespace(ctrl, req->cmd->identify.nsid);
    if (!req->ns) {
    - status = NVME_SC_INVALID_NS;
    + status = 0;
    goto done;
    }

    --
    2.27.0


    \
     
     \ /
      Last update: 2021-03-02 02:10    [W:4.030 / U:0.424 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site