lkml.org 
[lkml]   [2020]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] nvme/core:disable streams when get stream params failed
Date
After enable nvme streams, then if get stream params failed, 
We should disable streams before return error in
nvme_configure_directives() function.

Signed-off-by: Wu Bo <wubo40@huawei.com>
---
drivers/nvme/host/core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index f2adea9..afe1f5a 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -552,8 +552,10 @@ static int nvme_configure_directives(struct nvme_ctrl *ctrl)
return ret;

ret = nvme_get_stream_params(ctrl, &s, NVME_NSID_ALL);
- if (ret)
+ if (ret) {
+ nvme_disable_streams(ctrl);
return ret;
+ }

ctrl->nssa = le16_to_cpu(s.nssa);
if (ctrl->nssa < BLK_MAX_WRITE_HINTS - 1) {
--
1.8.3.1
\
 
 \ /
  Last update: 2020-05-06 10:24    [W:0.033 / U:0.780 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site