Re: [libsas PATCH v12 04/11] sysfs: handle 'parent deleted before child added'
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
Date: 2012-03-22 22:51:33
Also in:
linux-scsi
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
Date: 2012-03-22 22:51:33
Also in:
linux-scsi
On Mar 22 Williams, Dan J wrote:
On Thu, Mar 22, 2012 at 7:39 AM, Greg Kroah-Hartman [off-list ref] wrote:quoted
On Wed, Mar 21, 2012 at 11:32:14PM -0700, Dan Williams wrote:[..]quoted
quoted
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c index 7fdf6a7..86521ee 100644 --- a/fs/sysfs/dir.c +++ b/fs/sysfs/dir.c@@ -714,6 +714,9 @@ int sysfs_create_dir(struct kobject * kobj)else parent_sd = &sysfs_root; + if (!parent_sd) + return -ENOENT; + if (sysfs_ns_type(parent_sd)) ns = kobj->ktype->namespace(kobj); type = sysfs_read_ns_type(kobj);So what happens if this is true? Does this patch fix the oops?This patch downgrades the oops by turning it into a device_add() failure, but the patches that *fix* this warning are here [1] and here [2].
[...]
[1]: http://marc.info/?l=linux-scsi&m=133239707903443&w=2 [2]: http://marc.info/?l=linux-scsi&m=133239709603452&w=2
Isn't this something which is to be accomplished by counting references to the parent device? -- Stefan Richter -=====-===-- --== =-==- http://arcgraph.de/sr/