Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11296509ybi; Thu, 25 Jul 2019 13:38:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxQawkqNZEqkLm5UGOpEv9izD1KujR/uhrzbosBRosr3cHfoemRC4PVllvJcP2M2su+bGah X-Received: by 2002:a63:8ac3:: with SMTP id y186mr87502578pgd.13.1564087134123; Thu, 25 Jul 2019 13:38:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564087134; cv=none; d=google.com; s=arc-20160816; b=f+k9gfY+/vE2ToBKOZ3l4fa8dq1bFYelEbVo3ekmP/PUz+ex5BYd5wBHWG9i96neT/ V3ebA8CNcy60BFyxBWAL0eVHkoA9z7NrscN1ZUpk0EKRCVcxQ+KA+cHIU4s6QjhXNago 2Kh71+uDRByuNxiMcb63X+y+xmu59j1lcqTUTBbsfd8lIcvA14w8mgZ1aTVcHNypalgA UiBEwiCRqFiVQtNepWZJ9YR4rIKuoVbGrLOtDsX06HgsKVXvJLysU4pPtdWaGk9Ezku0 mlfE/9Ek6nDjkifH50VZwWOP8/d/LBR5sD/TWvz3TOS9ush0qKSFZR5G1kOlSN5mDjK2 oF5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to; bh=qbLY9g0QJGnw1V0mo4r2a67GiVxx0tFllGgLxexuF7Q=; b=ZKG5PU8Cly1/yuk0L/xwasVCHkdunycyfIRryfC2n40vyr4a4kyMGgOg/syY0RrYK7 zX9pqkyEIFQffJFHgWmLthS+lNh7kgTY5FmbVryhpwK8fyuuR7hYuFH+7h7OexnX+dWj X7IG27kyJsIzI8132HR0xjUd2gAhlJd12pURJD2shvUR3hemLZStPaeo0aDrpqOjDVLI 9IBf5gI/IZW3m7j9pKfTgUExlo2GaG9DlmW/SeMmFAkPh1LU1A7Sh9ASO/yi8sr7rQkY vQfVM/YM7oifAcKEXp1KZYeJcMTUEIgg90+DjaAE8hVYwbllKtWkcZ6WKod2K4EV4vGT BIxw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g2si21869807pfq.160.2019.07.25.13.38.38; Thu, 25 Jul 2019 13:38:54 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726907AbfGYUhV (ORCPT + 99 others); Thu, 25 Jul 2019 16:37:21 -0400 Received: from ale.deltatee.com ([207.54.116.67]:43852 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726741AbfGYUhU (ORCPT ); Thu, 25 Jul 2019 16:37:20 -0400 Received: from s01061831bf6ec98c.cg.shawcable.net ([68.147.80.180] helo=[192.168.6.132]) by ale.deltatee.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1hqkU7-0005Lc-87; Thu, 25 Jul 2019 14:37:08 -0600 To: Keith Busch Cc: Matthew Wilcox , linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, Christoph Hellwig , Sagi Grimberg , Jens Axboe , Chaitanya Kulkarni , Max Gurtovoy , Stephen Bates References: <20190725172335.6825-1-logang@deltatee.com> <20190725172335.6825-5-logang@deltatee.com> <20190725175023.GA30641@bombadil.infradead.org> <20190725195835.GA7317@localhost.localdomain> <5dd6a41d-21c4-cf8d-a81d-271549de6763@deltatee.com> <20190725203118.GB7317@localhost.localdomain> From: Logan Gunthorpe Message-ID: <3bb266ae-abf3-0146-5d93-e7a600453493@deltatee.com> Date: Thu, 25 Jul 2019 14:37:05 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190725203118.GB7317@localhost.localdomain> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 68.147.80.180 X-SA-Exim-Rcpt-To: sbates@raithlin.com, maxg@mellanox.com, Chaitanya.Kulkarni@wdc.com, axboe@fb.com, sagi@grimberg.me, hch@lst.de, linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, willy@infradead.org, kbusch@kernel.org X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-8.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE autolearn=ham autolearn_force=no version=3.4.2 Subject: Re: [PATCH v6 04/16] nvme-core: introduce nvme_get_by_path() X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-07-25 2:31 p.m., Keith Busch wrote: > On Thu, Jul 25, 2019 at 02:28:28PM -0600, Logan Gunthorpe wrote: >> >> >> On 2019-07-25 1:58 p.m., Keith Busch wrote: >>> On Thu, Jul 25, 2019 at 11:54:18AM -0600, Logan Gunthorpe wrote: >>>> >>>> >>>> On 2019-07-25 11:50 a.m., Matthew Wilcox wrote: >>>>> On Thu, Jul 25, 2019 at 11:23:23AM -0600, Logan Gunthorpe wrote: >>>>>> nvme_get_by_path() is analagous to blkdev_get_by_path() except it >>>>>> gets a struct nvme_ctrl from the path to its char dev (/dev/nvme0). >>>>>> >>>>>> The purpose of this function is to support NVMe-OF target passthru. >>>>> >>>>> I can't find anywhere that you use this in this patchset. >>>>> >>>> >>>> Oh sorry, the commit message is out of date the function was actually >>>> called nvme_ctrl_get_by_path() and it's used in Patch 10. >>> >>> Instead of by path, could we have configfs take something else, like >>> the unique controller instance or serial number? I know that's different >>> than how we handle blocks and files, but that way nvme core can lookup >>> the cooresponding controller without adding new cdev dependencies. >> >> Well the previous version of the patchset just used the ctrl name >> ("nvme1") and looped through all the controllers to find a match. But >> this sucks because of the inconsistency and the fact that the name can >> change if hardware changes and the number changes. Allowing the user to >> make use of standard udev rules seems important to me. > > Should we then create a new udev rule for persistent controller > names? /dev/nvme1 may not be the same controller each time you refer > to it. Udev can only create symlinks from /dev/nvme0 to /dev/nvme-persistent-name and users can do this as they need now. No changes needed. My point was if we use the ctrl name (nvme0) as a reference then the kernel can't make use of these symlinks or anything udev does seeing that name is internal to the kernel only. If we use cdev_get_by_path()/nvme_ctrl_get_by_path() then this isn't a problem as we can open a symlink to /dev/nvme0 without any issues. Logan