Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11186494ybi; Thu, 25 Jul 2019 11:29:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqxObDss/3nBbsBHUUar2KAidH1vI4C5J8ptMqQYcaefaHC0+zs8WJHYTv0/o2O++sU3Xf0k X-Received: by 2002:a63:c009:: with SMTP id h9mr60209844pgg.166.1564079387230; Thu, 25 Jul 2019 11:29:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564079387; cv=none; d=google.com; s=arc-20160816; b=kfyyKsUyRbhqG0DjZZIKdrom9Wy48FNvuKB/NVMNnn7xh2eSA6AjFo/ECqOJkEp2eJ gSNLZxQ4PHsEsGQn6AulfHSDXiD/RJ1pUrkvuQ8wyNu66LR0TVkT/vVWEwQYlNNT2XdA sFwSnclzil0Us+YJUSgfsgpif7uDHhJcuMSzLiHsRtq4V4u5EoFo6c0f+dfMX7c9KxB2 zYnnAFRajHdPHr9f6so0Z3gu9/bG01LsiTE1XSZzdMsj7yfjH2Ed9E6Fin6BwiORrCNV 00c5eWNtQ0MMhR/JrZjGSmlgtIXRBgF48ELBQIee/qsqvn6ndt/fwUiR5oI7A+G19FwV EwfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=7AAo5CFX2RqZKDIScl7TnVlPb8YEa7KTHw7axwJhNoM=; b=zG4P559dNixWNmoFb0XhIqd3nREjDu8+og8qSzn/I5eARYlWKc3IFC3D3czIXglX/2 EspxipYx2s+9+xDdlHEFdLx57adr4fPaYoquXZENjwJ+rvjoK+LqXSGzEj9OPQ/j77qG Kh/sukOPp4XnD0RThSOtDKPCUGLsGERycJ9zY4kJklYr96/wBjStD4AHH/0wA2SKCptt 4C1MYmnQL4XsvDjQQ8V5kAxqXTqawZUy3dXU7HfkxYXq49vzQo0Iit5o0HI63IV8Gx4Z bWzyMwZKlbFRKChqKEnf2mmPvyhDpa6l0zyK/ekCLvY/LljR0fZytvpalhSRkm8a+xqC 4JlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="ZFiFUxV/"; 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 x18si15047205pjq.71.2019.07.25.11.29.32; Thu, 25 Jul 2019 11:29:47 -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=@kernel.org header.s=default header.b="ZFiFUxV/"; 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 S1726074AbfGYS1F (ORCPT + 99 others); Thu, 25 Jul 2019 14:27:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:57988 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725800AbfGYS1E (ORCPT ); Thu, 25 Jul 2019 14:27:04 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 11B1E21734; Thu, 25 Jul 2019 18:27:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564079223; bh=9oxP8U7mgBf002tZ4PZF1DTXox9G1gTALMrim3Fxlzs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZFiFUxV/mTzC0oYE/9gO+4Kzsb/cAklpqkUhHQk/LwGLxSlItD8NE0NBPPS7Ns0w4 3ziwO1uqTtc1FkaqiR6f6sxhrnI5VA57r/bWofYojvWM9sxJoi7U4ssXrERo0HvAI2 qRUSkN4RRXttJU3Jv5n6moYPaH5huZ+n2lotiQE4= Date: Thu, 25 Jul 2019 20:27:01 +0200 From: Greg Kroah-Hartman To: Logan Gunthorpe 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 Subject: Re: [PATCH v6 02/16] chardev: introduce cdev_get_by_path() Message-ID: <20190725182701.GA11547@kroah.com> References: <20190725172335.6825-1-logang@deltatee.com> <20190725172335.6825-3-logang@deltatee.com> <20190725174032.GA27818@kroah.com> <682ff89f-04e0-7a94-5aeb-895ac65ee7c9@deltatee.com> <20190725180816.GA32305@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 25, 2019 at 12:14:33PM -0600, Logan Gunthorpe wrote: > > > On 2019-07-25 12:08 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. > > > > Why do you have a "string" within the kernel and are not using the > > normal open() call from userspace on the character device node on the > > filesystem in your namespace/mount/whatever? > > NVMe-OF is configured using configfs. The target is specified by the > user writing a path to a configfs attribute. This is the way it works > today but with blkdev_get_by_path()[1]. For the passthru code, we need > to get a nvme_ctrl instead of a block_device, but the principal is the same. Why isn't a fd being passed in there instead of a random string? Seems odd, but oh well, that ship sailed a long time ago for block devices I guess. So what do you actually _do_ with that char device once you have it? greg k-h