Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2832567ybk; Tue, 12 May 2020 09:10:29 -0700 (PDT) X-Google-Smtp-Source: APiQypKyktYcd+UNTHGYw1IF6x0JdE3CEZ7oMixYXuisRp5Zz70w8lLqmk8VmtdJRhCQ7BR+b9HF X-Received: by 2002:a17:906:2511:: with SMTP id i17mr18770580ejb.165.1589299829644; Tue, 12 May 2020 09:10:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589299829; cv=none; d=google.com; s=arc-20160816; b=wVX40KJKfZFE1JEp3nUWK3k666X0gfACTgaCFk8ZjVX/tHAysSlgNJiMXgFMSOOiy+ dOxossIPIifA9wWJm6NLw/7ZXOIzkAy+NjS+INI7OBnOCKZlE9uwvschtJr852XtWhJt BlAu5ToQxE0J2LBm5U+MixWvGSYoOixej6cPNZtEeLhztnjeV6KxHB0XrHePUgavXIir aC/m/FNlz2d7j+KoIoZvzhPFEqRb4FmbKIIaMcDkLhEG4KB1HD19oK4KaDDrkyHmXWG8 gCvLwZtW5GmXQnQOwn9MnjhKJe2PQR27OqE66ENJypIEAlDZ+Vy64JmeqA+zoM7an+N9 rWYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=yCo9YN021jF0gq53PvFQ+dpPu29jyGU8/CgRkqdSEE8=; b=zB19+VR6ic1S50B4IcqwN33O329Xsz7jOzZsYwoqPBmoIG8vWXarabOcsJGu0iudvA JjX1je3jwUZeak8Lf/Yep36M8slGdKdJQXKj0Q0yk/QtY85h1E3Rv669q62OIBBY/XYh V/cvGBDpcNGzZHTXagLP/hpnl20/n1W9cm0M1v1ObIEN+iILRRTuU/HdXBPSEG4XeVdm 944XDaM/0xLrUdi1qSUyBs9Yn3NpbLj6+F3PJT2YSeKPWBkaVraOUhRwk+QhX4l18iOz O0a2FDrKi8Fa7oe4wKoc6E62rhYOQU7NYawJVMsSWhy+07kzB3NvMcst0vAK0EC2WwSo kDYQ== 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 m10si8683707edr.459.2020.05.12.09.10.04; Tue, 12 May 2020 09:10:29 -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 S1725950AbgELQGX (ORCPT + 99 others); Tue, 12 May 2020 12:06:23 -0400 Received: from verein.lst.de ([213.95.11.211]:41975 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725554AbgELQGW (ORCPT ); Tue, 12 May 2020 12:06:22 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id ACFB468BEB; Tue, 12 May 2020 18:06:18 +0200 (CEST) Date: Tue, 12 May 2020 18:06:18 +0200 From: Christoph Hellwig To: Wu Bo Cc: kbusch@kernel.org, axboe@fb.com, hch@lst.de, sagi@grimberg.me, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, liuzhiqiang26@huawei.com, linfeilong@huawei.com Subject: Re: [PATCH] nvme/core:disable streams when get stream params failed Message-ID: <20200512160618.GA5403@lst.de> References: <1588754221-661597-1-git-send-email-wubo40@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1588754221-661597-1-git-send-email-wubo40@huawei.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 06, 2020 at 04:37:01PM +0800, Wu Bo wrote: > 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; > + } Please use a out_disable goto label to not duplicate the error handling with the other case that needs it.