Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3526395pxf; Mon, 15 Mar 2021 11:31:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8DcpwGfhL9yuJM51oqaGFWH2eF8brEULQU7YUItDihPfaOewr0unMNFjyaHfsgG5ZWFWZ X-Received: by 2002:a17:907:75c2:: with SMTP id jl2mr25563255ejc.334.1615833075510; Mon, 15 Mar 2021 11:31:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833075; cv=none; d=google.com; s=arc-20160816; b=s68Eb8EHn9S2KJSc0n7wO+8HUn3YZPdungvExOTM7PCa8aBfcRHqKOsKahOem8VNtQ o7LSmaQDhdBFel3L346OmcM4NCNdlE/oobrkjlALUmcRVz9B+7P1mC5arcGyRzLR1YzC OeMQ++iS82SPUcpvpRreFw/w+8+HuGsYppdycgyTvjpkVDurfBR3P5H8bCstoOLlBgsg 9Cf0f95UHdOzNw/y0ZCPNvvuCekYsCuVVxSo2VR88ci0w9IfmrRQSMOthOIuXD7vPZR2 mvNC6yP/7wF032HyhLK0JGUT7k/qMtpXsD/g5YCly5JfC9s7GvKIyN+NpLXnqOWAs6Rw JR9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dkEo0gMsxWMHEpD7aGr30bqCuhy3nUCdLqhQFTYk2No=; b=z1EL6DmQN2CtVRthXUiiv2hxzFO/33wh4agXxayk2vS68le7Ymo5+Qgi+KULi1F6QV H/EIrmO4wiV5XS868RPmilMr8xsL9d7477zJ0nptpdH0zkWygnBgoSL2HoBwz5jUdz2T oZYx06qJh5q6zuqXheJGfrqqQJHFY8Ikjd6smIXDlqTOQezZFW9X2lZ1Wo7a6fRPhgIv Fg3tB5SUC7KwRgobPFVA38R4tLhT9ckNGUOGxGbLY9Y3MsA7HcR41GSqKNUupnSVN7W4 QUYm1pgDQxf1x/EtL5FO+sk0ddavZZzJA3j55OF4XLB/cOQTvqYElTiASQhwCJ5vufRp Qzng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LuFMhMBE; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b67si12537609edf.490.2021.03.15.11.30.53; Mon, 15 Mar 2021 11:31:15 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LuFMhMBE; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231535AbhCOOe0 (ORCPT + 99 others); Mon, 15 Mar 2021 10:34:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:35446 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233404AbhCOOBj (ORCPT ); Mon, 15 Mar 2021 10:01:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4B6A164F0D; Mon, 15 Mar 2021 14:01:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816872; bh=NHI2zy8EIbXBo9+j9AzgGaNPZECXDU4lEsxTgk8kLpE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LuFMhMBERgysL0+jSkkccriCoUJL2IixorV3qLKubd2J5qC49hbBBx982lybUWcCS /HaLIg/I46/RFLdndkotWgL55XKQQqDUDY37v1rhK+maVzlha6p9RgWlCjttxbLrh/ A9PBjU29sflTcUz5EIOyEQTZhOBkiGzDGSAWCuK0= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Keith Busch , Sagi Grimberg , Christoph Hellwig , Jens Axboe Subject: [PATCH 5.4 163/168] nvme: release namespace head reference on error Date: Mon, 15 Mar 2021 14:56:35 +0100 Message-Id: <20210315135555.717916076@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135550.333963635@linuxfoundation.org> References: <20210315135550.333963635@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Keith Busch commit ac262508daa88fb12c5dc53cf30bde163f9f26c9 upstream. 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: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- drivers/nvme/host/core.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -3467,6 +3467,7 @@ static int nvme_init_ns_head(struct nvme "IDs don't match for shared namespace %d\n", nsid); ret = -EINVAL; + nvme_put_ns_head(head); goto out_unlock; } }