lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ijrqwufzr67dcemmswmlco2mbrajb3ueoeqhcqwvxqas2evzrx@wn25othf4377>
Date:   Fri, 8 Dec 2023 10:10:17 +0100
From:   Daniel Wagner <dwagner@...e.de>
To:     Christoph Hellwig <hch@....de>
Cc:     linux-nvme@...ts.infradead.org, linux-kernel@...r.kernel.org,
        Keith Busch <kbusch@...nel.org>,
        Sagi Grimberg <sagi@...mberg.me>,
        Hannes Reinecke <hare@...e.de>
Subject: Re: [PATCH v4 0/4] nvme: add csi, ms and nuse to sysfs

Hi Christoph,

On Thu, Dec 07, 2023 at 04:31:38PM +0100, Christoph Hellwig wrote:
> this looks generally good to me.  A few comments, all but one are
> cosmetic.
> 
> > @@ -1676,9 +1678,9 @@ static void nvme_init_integrity(struct gendisk *disk, struct nvme_ns *ns,
> 
> This an now take the ns_head instead of the ns.

Okay

> > @@ -1776,11 +1778,11 @@ static int nvme_init_ms(struct nvme_ns *ns, struct nvme_id_ns *id)
> 
> This can take a ctrl and ns_head instead of the ns.

Okay

> > @@ -1835,8 +1837,8 @@ static int nvme_configure_metadata(struct nvme_ns *ns, struct nvme_id_ns *id)
> 
> This as well after updating nvme_ns_has_pi to take the ns_head.

Okay

> > @@ -1898,7 +1900,7 @@ static void nvme_update_disk_info(struct gendisk *disk,
> >  		struct nvme_ns *ns, struct nvme_id_ns *id)
> 
> This as well after fixing up nvme_lba_to_sect to take the ns_head.

Okay

> 
> > @@ -2052,7 +2055,7 @@ static int nvme_update_ns_info_block(struct nvme_ns *ns,
> 
> This one as well.

When trying to refactor this function I run into a bit of trouble with
dependencies. Basically, we would need to pass through nvme_ctrl,
request_queue, gendisk and nvme_ns_head and still need nvme_ns in
nvme_update_zone_info:

nvme_update_ns_info_block
  blk_mq_freeze_queue(ns->disk->queue)
  nvme_set_chuck_sector(ns->queue)
  nvme_update_zone_info()
    set_bit(NVME_NS_FORCE_RO, ns->flags)
    blk_queue_flag_set(QUEUE_FLAG_ZONE_RESETALL, q);

I suggest we don't refactor this part now. At least it I don't see an
good way to avoid passing down nvme_ns as we still need this data
structure in deeper down the call chain.

> > @@ -128,7 +129,7 @@ static void *nvme_zns_alloc_report_buffer(struct nvme_ns *ns,
> >  				   sizeof(struct nvme_zone_descriptor);
> >  
> >  	nr_zones = min_t(unsigned int, nr_zones,
> > -			 get_capacity(ns->disk) >> ilog2(ns->zsze));
> > +			 get_capacity(ns->head->disk) >> ilog2(ns->head->zsze));
> 
> This doesn't work, as the head disk doesn't exist for !multipath
> setups.

I was a bit trigger happy here. Changed it back to 'get_capacity(ns->disk)'.

> > @@ -162,7 +163,7 @@ static int nvme_zone_parse_entry(struct nvme_ns *ns,
> 
> This could do with ctrl + ns_head now

Okay.

Thanks,
Daniel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ