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]
Date:   Mon, 4 Dec 2023 11:56:05 +0100
From:   Daniel Wagner <dwagner@...e.de>
To:     Sagi Grimberg <sagi@...mberg.me>
Cc:     linux-nvme@...ts.infradead.org, linux-kernel@...r.kernel.org,
        Keith Busch <kbusch@...nel.org>,
        Christoph Hellwig <hch@....de>, Hannes Reinecke <hare@...e.de>
Subject: Re: [RFC v2 2/3] nvme: move ns id info to struct nvme_ns_head

On Mon, Dec 04, 2023 at 10:30:52AM +0200, Sagi Grimberg wrote:
> > -bool nvme_mpath_clear_current_path(struct nvme_ns *ns)
> > +bool nvme_mpath_clear_current_path(struct nvme_ns_head *head)
> >   {
> > -	struct nvme_ns_head *head = ns->head;
> >   	bool changed = false;
> >   	int node;
> > @@ -181,7 +183,7 @@ bool nvme_mpath_clear_current_path(struct nvme_ns *ns)
> >   		goto out;
> >   	for_each_node(node) {
> > -		if (ns == rcu_access_pointer(head->current_path[node])) {
> > +		if (head == rcu_access_pointer(head->current_path[node])->head) {
> >   			rcu_assign_pointer(head->current_path[node], NULL);
> >   			changed = true;
> >   		}
> 
> I'm not sure about this one.
> 
> This is changing the behavior of the function. Previously  it only
> cleared the current_path if it was directed to ns, now it will if the
> current_path has the same head, which is always the case isn't it?
> 
> I'm unsure to why this change is needed?

As Christoph pointed out we really need to check the ns pointer. I tried
to workaound not to use nvme_ctrl_find_ns. Anyway, I'll drop this hunk
here.

Thanks,
Daniel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ