Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1595921ybj; Wed, 6 May 2020 01:25:09 -0700 (PDT) X-Google-Smtp-Source: APiQypJOmmPEL4T4MGhj7YKdEnN84AKeznU/lzOSjvooSn5nVZok5Q6OQE/pz6KDitaAhgWV0Oox X-Received: by 2002:a50:950a:: with SMTP id u10mr6059823eda.45.1588753508893; Wed, 06 May 2020 01:25:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588753508; cv=none; d=google.com; s=arc-20160816; b=SFQutBmyjwY3/dNd58eOVZEva5l8TuHNCtdi+c3fHujO34pY0cQvTt1yMs/mFOsrMP voz0/2NVjfx7Pt9qQfYS1wVa2yCM7Wi7u+F/FIPhUqkNx1tmwcpaHgh6LKJaYPgDbIL7 6TyQTE6SRPczVFmbky4lc8Ju3uDOj5Vpiz+IBhuf2G22ViE1YLzC9RwFGyZCc8vUgbOB 0f3sNg3W21kOfinxCphXlh+05/rY8dLiojxKG8xItXPeuV3zoVFXbkVX7RwzlpZ9EkrT Gi8ldHIpBWe5MGVb9doPVt+fMSjlFtz6MrZgyctHqwGAgab9b2kzIqmROfdk0+Hd/W1C pweg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=I2Z1ILYwXIZkkne6AHmck5HaILARDxbBI3Mlq6RhI58=; b=rLJQwjGEzO46byEJoE9ivX7LgQpx7sIEMFo+EUj3EWTWTkwzOadLwuZ2YiNbryM4cj R9KvNBCQSqws4yk9xU42Fp0Mxzefzf7W84TGMRueRnrh1n2LI9/R9su9wJ3TjDkH59H2 5VS63+iRg6WASffW7nEhGjoXbKW8eMtai5hLj2FWnu32dj6xqz8pAw4miLSP5InkEc/J MjQ1ZbU82HpglZBLSf+ykqP8ubLsdqTR0ozVPTeOe5V5FUUY6Ca+1ecyp3xbpbUqAA8U R7mESIjK13f3W6vjDN9DP/rcI74lSjqeu7d+ea2uT2CCpfH+VcE9zE7gElM024Zd7vTI kb2g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y10si620365edt.393.2020.05.06.01.24.46; Wed, 06 May 2020 01:25:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728821AbgEFIXR (ORCPT + 99 others); Wed, 6 May 2020 04:23:17 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:3860 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728349AbgEFIXQ (ORCPT ); Wed, 6 May 2020 04:23:16 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 071CC32915EF8542B1BD; Wed, 6 May 2020 16:23:15 +0800 (CST) Received: from huawei.com (10.175.105.27) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Wed, 6 May 2020 16:23:05 +0800 From: Wu Bo To: , , , CC: , , , , Subject: [PATCH] nvme/core:disable streams when get stream params failed Date: Wed, 6 May 2020 16:37:01 +0800 Message-ID: <1588754221-661597-1-git-send-email-wubo40@huawei.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.105.27] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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