Re: [PATCH V3] nvme: enable char device per namespace

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On 15 Dec 2020, at 23.46, Keith Busch <kbusch@xxxxxxxxxx> wrote:
> 
> On Tue, Dec 15, 2020 at 08:55:57PM +0100, javier@xxxxxxxxxxx wrote:
>> +static int nvme_alloc_chardev_ns(struct nvme_ctrl *ctrl, struct nvme_ns *ns)
>> +{
>> +    char cdisk_name[DISK_NAME_LEN];
>> +    int ret;
>> +
>> +    device_initialize(&ns->cdev_device);
>> +    ns->cdev_device.devt = MKDEV(MAJOR(nvme_ns_base_chr_devt),
>> +                     ns->head->instance);
> 
> Ah, I see now. We are making these generic handles for each path, but
> the ns->head->instance is the same for all paths to a namespace, so it's
> not unique for that. Further, that head->instance is allocated per
> subsystem, so it's not unique from namespace heads seen in other
> subsystems.
> 
> So, I think you need to allocate a new dev_t for each subsystem rather
> than the global nvme_ns_base_chr_devt, and I guess we also need a new
> nvme_ns instance field assigned from yet another ida?

Ok. I’ll look into it. 

Thanks!



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux