[PATCH V6 0/2] nvme: enable char device per namespace

javier at javigon.com javier at javigon.com
Mon Mar 1 19:24:50 GMT 2021


From: Javier González <javier.gonz at samsung.com>

These two patches enable a char device per namespace, also through
multipath. It is possible to test this in QEMU using Keith's and Klaus'
tree in nvme-next

     http://git.infradead.org/qemu-nvme.git/shortlog/refs/heads/nvme-next


One question that came up while preparing V6 is what to do with the bdev
sysfs entries when the block device fails. On the one hand, these values
are useful for the char device, but on the other, they are in principle
only valid for the block device. We have 3 options: (i) clear sysfs when
bdev fails and require user-space to query the nvme device directly
through sysfs, (ii) maintain the bdev sysfs entries, and (iii) make char
device dedicated sysfs entries, which might be redundant when both the
char device and the block device are brought up. Thoughts?

Keith: Regarding nvme-cli support, once this is in place, we will send a
patch to nvme-cli so that this device is shown in verbose mode. Do you
have anu thoughts about this?

Changes since V5
  - Addressed style and naming comments from Christoph
  - Change the logic around nvme_update_ns_info() to (i) make the
    GENHD_FL_HIDDEN more explicit in the init logic, and (ii) to support
    an error path that also stops the char device from being created.
    This error path is not exercised currently.

Changes since V4
  - Added support for multipath (from Minwoo)
  - Fixed typo in commit message for sysfs naming
  - Rebase into nvme-5.12

Changes since V3
  - Use a dedicated ida for the generic handle
  - Do not abort namespace greation if the generic handle fails

Changes since V2:
  - Apply a number of naming and code structure improvements (from
    Christoph)
  - Use i_cdev to pull struct nvme_ns in the ioctl path instead of
    populating file->private_data (from Christoph)
  - Change char device and sysfs entries to /dev/nvme-generic-XcYnZ to
    follow the hidden device naming scheme (from Christoph and Keith)

Changes since V1:
  - Remove patches 1-3 which are already picked up by Christoph
  - Change the char device and sysfs entries to nvmeXnYc / c signals
    char device
  - Address Minwoo's comments on inline functions and style


Javier González (1):
  nvme: enable char device per namespace

Minwoo Im (1):
  nvme: allow open for nvme-generic char device

 drivers/nvme/host/core.c | 198 ++++++++++++++++++++++++++++++++++-----
 drivers/nvme/host/nvme.h |   5 +
 2 files changed, 182 insertions(+), 21 deletions(-)

-- 
2.17.1




More information about the Linux-nvme mailing list