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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1578531860.3852.7.camel@linux.ibm.com>
Date:   Wed, 08 Jan 2020 17:04:20 -0800
From:   James Bottomley <jejb@...ux.ibm.com>
To:     John Garry <john.garry@...wei.com>,
        Greg KH <gregkh@...uxfoundation.org>
Cc:     "Martin K . Petersen" <martin.petersen@...cle.com>,
        "linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
        Linuxarm <linuxarm@...wei.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "saravanak@...gle.com" <saravanak@...gle.com>,
        Arnd Bergmann <arnd@...db.de>
Subject: Re: [PATCH v1] driver core: Use list_del_init to replace list_del
 at device_links_purge()

On Wed, 2020-01-08 at 17:10 +0000, John Garry wrote:
> On 08/01/2020 16:08, John Garry wrote:
> > On 08/01/2020 16:01, James Bottomley wrote:
> > > > > >     cdev->dev = NULL;
> > > > > >             return device_add(&cdev->cdev);
> > > > > >         }
> > > > > >     }
> > > > > >     return -ENODEV;
> > > > > > }
> > > > > 
> > > > > The design of the code is simply to remove the link to the
> > > > > inserted device which has been removed.
> > > > > 
> > > > > I*think*  this means the calls to device_del and device_add
> > > > > are unnecessary and should go.  enclosure_remove_links and
> > > > > the put of the enclosed device should be sufficient.
> > > > 
> > > > That would make more sense than trying to "reuse" the device
> > > > structure here by tearing it down and adding it back.
> > > 
> > > OK, let's try that.  This should be the patch if someone can try
> > > it (I've compile tested it, but the enclosure system is under a
> > > heap of stuff in the garage).
> > 
> > I can test it now.
> > 
> 
> Yeah, that looks to have worked ok. SES disk locate was also fine
> after losing and rediscovering the disk.

OK, I'll spin up a patch with fixes/reported and tested tags.

> Thanks,
> John
> 
> > But it is a bit suspicious that we had the device_del() and
> > device_add() at all, especially since the code change makes it look
> > a bit more like pre-43d8eb9cfd0 ("ses: add support for enclosure
> > component hot removal")

I think the original reason was to clean out the links.  I vaguely
remember there was once a time when you couldn't clear all the links
simply with sysfs_remove_link.  However, nowadays you can.

James

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ