Gabor Gombas wrote:
> Hi,
> 
> On Sat, Jan 05, 2008 at 07:50:39AM +0000, Al Viro wrote:
> 
>> Could you stick
>>      if (!parent->d_inode)
>>              printk(KERN_WARNING "sysfs locking blows: %s",
>>                      parent->d_name.name);
>> right before
>>                 mutex_lock(&parent->d_inode->i_mutex);
>>                 dentry = lookup_one_noperm(cur->s_name, parent);
>>                 mutex_unlock(&parent->d_inode->i_mutex);
>> in sysfs_get_dentry() (fs/sysfs/dir.c) and verify that it does, indeed,
>> trigger?
> 
> Here it is:
> 
> Jan  7 14:35:43 twister kernel: sysfs locking blows: acl001BAFE1624D<1>Unable 
> to handle kernel NULL pointer dereference at 00000000000000b8 RIP: 

Does the attached patch fix the problem?

-- 
tejun
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 3371629..4e7f3bf 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -878,7 +878,6 @@ again:
 	error = 0;
 	d_add(new_dentry, NULL);
 	d_move(old_dentry, new_dentry);
-	dput(new_dentry);
 
 	/* Remove from old parent's list and insert into new parent's list. */
 	sysfs_unlink_sibling(sd);

Reply via email to