Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp2933285pxy; Mon, 3 May 2021 11:10:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmsRmxoeXaiShQBlPeZ1GIWDh9LpbEGnKabU72keYhCuukLUnz6Q+ubAsnEPVhqZQ2pezx X-Received: by 2002:a17:906:8904:: with SMTP id fr4mr10894661ejc.146.1620065454283; Mon, 03 May 2021 11:10:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620065454; cv=none; d=google.com; s=arc-20160816; b=qx+Wh/re1o2+d/0ZQCzGPin6061HTvDfkYvvc5pZ+si9RzsJW8W/hsOe7Vw6/Tb+is mxV2i6n3A3w7TWXP9xflnj6xddDkpKej7f0E15EBkNmCrde+Sv5TUfp/dXVLvS3OOU6w LLL7RpD4Y6OmveosPxzh/Q2doggnI8+Doexu0QePMfuNNei4NY0/LX3Ec4loi9KxJn/4 mDFbb/AvJtwyH3Ec0eJeIO4z24+j8V/JkW/Yp/jSsQDKI/CQfs9TuHL1uIurzbe946fv Yp3yljW8dGqDYXER0Oj4HQyHiJD9+a9cJIdi8v/d0+uQNeCFs8Z44o9TrRgkOS3B7XZn Dm2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=6p5oZbkhtk5XknkAiA5IrgGZY9W2Qnms+dn7b9vj9jY=; b=GeA2Cf5Ve2unJ4er9zEmTbgW9E6DibsjlVSmxI3BUmdXIm/6/KyyvF3jFX/OsYIEoO VaVNQSnos39ncCn6yXqnYLuHWBPnBV6WeV9HUjoj6dwfHHetvlAgptiDThl90BfRw6QA cmJCgfT9P8paUz7P123Yuf/mxn49u/YD7X/dlc3rrUa85ZIwK0X4fpVYEddJrvQD5FSC ArPeQdikeWC4kQBdP3NmapGawLT13hg5srdmHJACc+3IjjmDTdp3x906Qwq6xt077JwM BIqQyj72gzNRzds0esZokhi21abCjkSpgQLGFL8SSTBf6huICGrnDF2LWdf8kbPDWeHS cCNA== 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 v13si431400ejh.540.2021.05.03.11.10.30; Mon, 03 May 2021 11:10:54 -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 S231143AbhECPyn (ORCPT + 99 others); Mon, 3 May 2021 11:54:43 -0400 Received: from verein.lst.de ([213.95.11.211]:35575 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230501AbhECPym (ORCPT ); Mon, 3 May 2021 11:54:42 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 9D5AA68BEB; Mon, 3 May 2021 17:53:45 +0200 (CEST) Date: Mon, 3 May 2021 17:53:45 +0200 From: Christoph Hellwig To: Daniel Wagner Cc: linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Hannes Reinecke , Keith Busch , Jens Axboe , Christoph Hellwig Subject: Re: [PATCH] nvme-multipath: Reset bi_disk to ns head when failover Message-ID: <20210503155345.GA5342@lst.de> References: <20210503125741.68117-1-dwagner@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210503125741.68117-1-dwagner@suse.de> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 03, 2021 at 02:57:41PM +0200, Daniel Wagner wrote: > The path can be stale when we failover. If we don't reset the bdev to > the ns head and the I/O finally completes in end_io() it will triggers > a crash. By resetting the to ns head disk so that the submit path can > map the request to an active path. > > Signed-off-by: Daniel Wagner > --- > > The patch is against nvme-5.13. There is no bi_disk in nvme-5.13, but fortunately that slipped in only in the subject. > + bdev = bdget_disk(ns->head->disk, 0); Please just use ns->head->disk->part0 directly. No need for the reference and bdget_disk is about to go away.