Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8769033ybi; Tue, 9 Jul 2019 22:52:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpf0jT+0R8EZu6FMP1KNRd7Vyvw4d+81DTb22e/z9Tcjt4NT9aWWCMhl2942YxE6WtfYaz X-Received: by 2002:a17:902:e202:: with SMTP id ce2mr33238708plb.272.1562737973347; Tue, 09 Jul 2019 22:52:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562737973; cv=none; d=google.com; s=arc-20160816; b=J9O7Nx0GTK/xBzK1EMjFrQwB1NOXgTT1XIUyJ7kBs7oVtfsTCUAdbzt1P/5NefKoxf +lcO2YcOa6UkixqBWdf7M78/rQVxFDWE/JHkdHsP9uS6SqkCslJ2dRL1L6gYC2E0dygi 6fOmTb0XZ/T1001bmsPI7hcDlipCQc/Opy0P2yt84lEzyuagyA3L9NErM9EEl6Y9qa23 2R0SvuiCQgy9ilgad6H+AB0vE/YfkEVEcTY32RUxScPhbYKog+IoHpf4GCVc1SzJq3Ai DyNEG3yv41I3SkFrebIZpDJYgHIzjSEsHlr4q0Q6MoCcKAS/p5CcEMCNc0aeY4CkeKIA K9FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:dkim-signature:dkim-filter; bh=+2lMnvpoKjx0Ngf9cwUYGi4yi5g7W+P6A5+xpsO8iBY=; b=l/+IqAQ6bE9BMKiXMCkRjjQ0NUn7lujJx/h3qloyiZckZkE8wXEPDJbnykZRP13Jsz ubagHnZXK8fJzZtXMPcA5KxyMZxIp4aXqcIi5E9s6iYDPvzt0hXj+pJVME+wi+G3+fQ7 xOWXt6oNfmCUZkFf7TpJdi+HEsR+ux8VProxXR6zK25DZ5l0MQ4rzGvq3qSnWLyXCo4P 1mNjAV+aPwLbfsIVQZeVu69V916svdl0QX0f0sdlKxd7eLaym4vNzbv/Z+OTHCAIRj5j ruuZERXk2L6E0SlMU3ZfI6BKl3VWxZXNL7b69oMJ6r10i1fyqzYIeaULEjKSBCi6V6Qb NLSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kalray.eu header.s=32AE1B44-9502-11E5-BA35-3734643DEF29 header.b=aqNTLf+X; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=kalray.eu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d139si1290034pfd.91.2019.07.09.22.52.37; Tue, 09 Jul 2019 22:52:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kalray.eu header.s=32AE1B44-9502-11E5-BA35-3734643DEF29 header.b=aqNTLf+X; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=kalray.eu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727058AbfGJF0z (ORCPT + 99 others); Wed, 10 Jul 2019 01:26:55 -0400 Received: from zimbra2.kalray.eu ([92.103.151.219]:38278 "EHLO zimbra2.kalray.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725932AbfGJF0z (ORCPT ); Wed, 10 Jul 2019 01:26:55 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTP id 7A0362BE068D; Wed, 10 Jul 2019 07:26:54 +0200 (CEST) Received: from zimbra2.kalray.eu ([127.0.0.1]) by localhost (zimbra2.kalray.eu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id JlrKVqP9bF-r; Wed, 10 Jul 2019 07:26:47 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTP id E23272BE0691; Wed, 10 Jul 2019 07:26:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.10.3 zimbra2.kalray.eu E23272BE0691 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kalray.eu; s=32AE1B44-9502-11E5-BA35-3734643DEF29; t=1562736406; bh=+2lMnvpoKjx0Ngf9cwUYGi4yi5g7W+P6A5+xpsO8iBY=; h=Date:From:To:Message-ID:MIME-Version; b=aqNTLf+XfRmJ9UKN6JcmU8vF/naP12Zw/pqnA9Pmg8CPQkC8CscnENMnR7foF8tP5 UMLBS27LdDAHiBuDb+ClP9Cg07IrGoIqBhIWLN8yUVrfU0t5INts0ZsEdL3MkdhQ8G qA5KS5hh+I6mX2rgw/F+fHCw4Kp36lvQGzQ2+UaM= X-Virus-Scanned: amavisd-new at zimbra2.kalray.eu Received: from zimbra2.kalray.eu ([127.0.0.1]) by localhost (zimbra2.kalray.eu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id NUe8OLhz0rwc; Wed, 10 Jul 2019 07:26:46 +0200 (CEST) Received: from zimbra2.kalray.eu (zimbra2.kalray.eu [192.168.40.202]) by zimbra2.kalray.eu (Postfix) with ESMTP id C9F532BE0631; Wed, 10 Jul 2019 07:26:46 +0200 (CEST) Date: Wed, 10 Jul 2019 07:26:46 +0200 (CEST) From: Marta Rybczynska To: Christoph Hellwig Cc: Max Gurtovoy , kbusch , axboe , Sagi Grimberg , linux-nvme , linux-kernel , Samuel Jones , Jean-Baptiste Riaux Message-ID: <516302383.30860772.1562736406606.JavaMail.zimbra@kalray.eu> In-Reply-To: <20190709212904.GB9636@lst.de> References: <1575872828.30576006.1562335512322.JavaMail.zimbra@kalray.eu> <989987da-6711-0abc-785c-6574b3bb768c@mellanox.com> <20190709212904.GB9636@lst.de> Subject: Re: [PATCH v2] nvme: fix multipath crash when ANA desactivated MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.40.202] X-Mailer: Zimbra 8.8.12_GA_3794 (ZimbraWebClient - FF57 (Linux)/8.8.12_GA_3794) Thread-Topic: nvme: fix multipath crash when ANA desactivated Thread-Index: 3ZiudTJo+4Xoo4yxPm7HpynQ7U2Unw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- On 9 Jul, 2019, at 23:29, Christoph Hellwig hch@lst.de wrote: > On Sat, Jul 06, 2019 at 01:06:44PM +0300, Max Gurtovoy wrote: >>> + /* check if multipath is enabled and we have the capability */ >>> + if (!multipath) >>> + return 0; >>> + if (!ctrl->subsys || ((ctrl->subsys->cmic & (1 << 3)) != 0)) >> >> shouldn't it be: >> >> if (!ctrl->subsys || ((ctrl->subsys->cmic & (1 << 3)) == 0)) >> >> or >> >> if (!ctrl->subsys || !(ctrl->subsys->cmic & (1 << 3))) >> >> >> Otherwise, you don't really do any initialization and return 0 in case you have >> the capability, right ? > > Yes. FYI, my idea how to fix this would be something like: Thanks both, error when changing the condition on my side. I submit the next version very soon. Christoph, why would you like to put the use_ana function in the header? It isn't used anywhere else outside of that file. Regards, Marta