Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11176942ybi; Thu, 25 Jul 2019 11:18:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqwisg3d7WpHilPC311K3UF7sgQg+mX5ZPdWcS97FXVwZpCl4G+2/BlwZY53HuCQRi3x6jXp X-Received: by 2002:a63:6bc5:: with SMTP id g188mr57046819pgc.225.1564078700153; Thu, 25 Jul 2019 11:18:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564078700; cv=none; d=google.com; s=arc-20160816; b=pbnX4QIRsfkfrg6RSvd1NG1vayNlg5vnDCmrb1pGG+BCgsPjH1Ng+OXyk4kk67JWKl VLmmgfCdD4it3VB/UZlEIwyojXuUDUNtHkSRlHZ9NOToE8Dr1X+aah8ScfdO24zZ1Plw 4ZqjtDP6bK8TFVvXmCuceQVhAr8jf1abH2f6i+QLJJ0BfudGDZhA2g/Sj669skpGYP2d lcIvL3fjgbi6weOrwUXKQML+6Nn8RGcL8anGR2obmQQKE6GCFzXCGylF5X14lSeYkQjQ AkViLB83wXa6LkM0NnH92Bix0XItu90vzb542tTgw5U1s5yweGKGBehg5F8/x7BLB6jE HndA== 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=E0oabEW//G0BTgpfR4d+6sEG2MrusOmydpbmnvbNzgw=; b=tTePJzrycAMaBLifQNH0nqrBaXWthNMQF0N3tt1kk2+VUmo4dMbxnUhENqIuNeHTb5 SgOeG7L04wGMU2Fs43hhJo+fgWfLQHGC4q5UyE+JkfqaEjFd3FvOasZ4tmk5gHZT7WR8 83iJOsCfJPGW63XV20XcMOdeiWhKqn+v5sJjumV0itcqZge8rlzWTPetj3kGSlBwUUZi C3RcTjXyNY1FXqSb16rIQsZIyz4wl7wCXt+WFFctITQTsG8bwtRvymHa6fe+aLj0rNy6 RF5RSCLeIbbb7WIsL0wAE73MrQknuG/5S/l239pjNRZIfrkXOscriAIPePKcFUmBuQqB aJJg== 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 3si16683782plh.265.2019.07.25.11.18.05; Thu, 25 Jul 2019 11:18:20 -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 S1726470AbfGYSQX (ORCPT + 99 others); Thu, 25 Jul 2019 14:16:23 -0400 Received: from ale.deltatee.com ([207.54.116.67]:40980 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725800AbfGYSQW (ORCPT ); Thu, 25 Jul 2019 14:16:22 -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 1hqiHh-0002Rr-E3; Thu, 25 Jul 2019 12:16:10 -0600 To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, Christoph Hellwig , Sagi Grimberg , Keith Busch , Jens Axboe , Chaitanya Kulkarni , Max Gurtovoy , Stephen Bates , Alexander Viro References: <20190725172335.6825-1-logang@deltatee.com> <20190725172335.6825-3-logang@deltatee.com> <20190725174032.GA27818@kroah.com> <682ff89f-04e0-7a94-5aeb-895ac65ee7c9@deltatee.com> <20190725181041.GB32305@kroah.com> From: Logan Gunthorpe Message-ID: <824d6fd3-56ff-7b69-9e0a-52198a2f4184@deltatee.com> Date: Thu, 25 Jul 2019 12:16:08 -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: <20190725181041.GB32305@kroah.com> 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: viro@zeniv.linux.org.uk, sbates@raithlin.com, maxg@mellanox.com, Chaitanya.Kulkarni@wdc.com, axboe@fb.com, kbusch@kernel.org, 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, gregkh@linuxfoundation.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 02/16] chardev: introduce cdev_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 12:10 p.m., Greg Kroah-Hartman wrote: > On Thu, Jul 25, 2019 at 11:53:20AM -0600, Logan Gunthorpe wrote: >> >> >> On 2019-07-25 11:40 a.m., Greg Kroah-Hartman wrote: >>> On Thu, Jul 25, 2019 at 11:23:21AM -0600, Logan Gunthorpe wrote: >>>> cdev_get_by_path() attempts to retrieve a struct cdev from >>>> a path name. It is analagous to blkdev_get_by_path(). >>>> >>>> This will be necessary to create a nvme_ctrl_get_by_path()to >>>> support NVMe-OF passthru. >>> >>> Ick, why? Why would a cdev have a "pathname"? >> >> So we can go from "/dev/nvme0" (which points to a char device) to its >> struct cdev and eventually it's struct nvme_ctrl. Doing it this way also >> allows supporting symlinks that might be created by udev rules. >> >> This is very similar to blkdev_get_by_path() that lets regular NVMe-OF >> obtain the struct block_device from a path. >> >> I didn't think this would be all that controversial. >> >>> What is "NVMe-OF passthru"? Why does a char device node have anything >>> to do with NVMe? >> >> NVME-OF passthru is support for NVME over fabrics to directly target a >> regular NVMe controller and thus export an entire NVMe device to a >> remote system. We need to be able to tell the kernel which controller to >> use and IMO a path to the device file is the best way as it allows us to >> support symlinks created by udev. > > open() in userspace handles symlinks just fine, what crazy interface > passes a string to try to find a char device node that is not open()? configfs. Which I'm stuck with seeing nvme-of already uses that for configuration and I don't think that's going to change... > And why do you need a char device at all anyway? Is this just the > "normal" nvme controller's character device node? Yes. Logan