Re: [PATCH] Add a refcount check in dput()

2007-09-17 Thread Andrew Morton
On Mon, 17 Sep 2007 11:21:35 -0700 "Paul Menage" <[EMAIL PROTECTED]> wrote: > On 9/15/07, Andrew Morton <[EMAIL PROTECTED]> wrote: > > > > > > + BUG_ON(!atomic_read(&dentry->d_count)); > > > repeat: > > > if (atomic_read(&dentry->d_count) == 1) > > > might_sleep(); > > > >

Re: [PATCH] Add a refcount check in dput()

2007-09-17 Thread Paul Menage
On 9/15/07, Andrew Morton <[EMAIL PROTECTED]> wrote: > > > > + BUG_ON(!atomic_read(&dentry->d_count)); > > repeat: > > if (atomic_read(&dentry->d_count) == 1) > > might_sleep(); > > eek, much too aggressive. How about the equivalent BUG_ON() in dget()? I figure that they o

Re: [PATCH] Add a refcount check in dput()

2007-09-15 Thread Andrew Morton
On Mon, 10 Sep 2007 15:13:19 -0700 (PDT) [EMAIL PROTECTED] (Paul Menage) wrote: > Add a BUG_ON() to check for passing an unreferenced dentry to dput(). > > This is analogous to the similar check in dget(), and will make > reference-counting bugs in filesystems more immediately obvious. (I > just

[PATCH] Add a refcount check in dput()

2007-09-10 Thread Paul Menage
Add a BUG_ON() to check for passing an unreferenced dentry to dput(). This is analogous to the similar check in dget(), and will make reference-counting bugs in filesystems more immediately obvious. (I just spent a while debugging an oops that turned out to be due to broken fs reference counting.)