提交 bd656f0e 编写于 作者: K Keith Busch 提交者: Yang Yingliang

nvme: release namespace head reference on error

mainline inclusion
from mainline-v5.8-rc1
commit ac262508
category: bugfix
bugzilla: NA
CVE: NA
Link: https://gitee.com/openeuler/kernel/issues/I1WGZE

--------------------------------

If a namespace identification does not match the subsystem's head for
that NSID, release the reference that was taken when the matching head
was initially found.
Signed-off-by: NKeith Busch <kbusch@kernel.org>
Reviewed-by: NSagi Grimberg <sagi@grimberg.me>
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
Reviewed-by: NChao Leng <lengchao@huawei.com>
Reviewed-by: NJike Cheng <chengjike.cheng@huawei.com>
Signed-off-by: NLijie <lijie34@huawei.com>
Acked-by: NHanjun Guo <guohanjun@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 614a0676
...@@ -3146,6 +3146,7 @@ static int nvme_init_ns_head(struct nvme_ns *ns, unsigned nsid, ...@@ -3146,6 +3146,7 @@ static int nvme_init_ns_head(struct nvme_ns *ns, unsigned nsid,
"IDs don't match for shared namespace %d\n", "IDs don't match for shared namespace %d\n",
nsid); nsid);
ret = -EINVAL; ret = -EINVAL;
nvme_put_ns_head(head);
goto out_unlock; goto out_unlock;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册