Commit 8ba212a8 authored by Sagi Grimberg's avatar Sagi Grimberg Committed by Yang Yingliang
Browse files

nvme: put ns_head ref if namespace fails allocation

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



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

In case nvme_alloc_ns fails after we initialize ns_head but before we
add the ns to the controller namespaces list we need to explicitly put
the ns_head reference because when we teardown the controller we
won't find it, causing us to leak a dangling subsystem eventually.

Signed-off-by: default avatarSagi Grimberg <sagi@grimberg.me>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Reviewed-by: default avatarChao Leng <lengchao@huawei.com>
Reviewed-by: default avatarJike Cheng <chengjike.cheng@huawei.com>
Signed-off-by: default avatarLijie <lijie34@huawei.com>
Reviewed-by: default avatarTao Hou <houtao1@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent aa8d040e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment