lkml.org 
[lkml]   [2004]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [linux-usb-devel] [PATCH] back out sysfs reference count change
On Thu, 1 Apr 2004, Maneesh Soni wrote:

> On Wed, Mar 31, 2004 at 10:11:37AM -0500, Alan Stern wrote:
> >
> > Here's a suggestion. At the start of check_perm() grab the dentry
> > semaphore, then check whether d_fsdata is NULL, if it isn't then do the
> > kobject_get(), then unlock the semaphore.
> >
>
> I have tried this with no luck. I still get
> (Badness in kobject_get at lib/kobject.c:42) which means it is not correct fix.

Did you remember to set dentry->d_fsdata to NULL? This has to be done in
sysfs_remove_dir() sometime during the period when dentry->d_inode->i_sem
is held. Right now the pointer to the kobject never gets erased. That
Badness message is an indication that you are using a valid pointer to a
kobject whose refcount is 0.

Alan Stern

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:02    [W:0.095 / U:0.572 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site