Re: 2.6.16-rc5-mm1

J.A. Magallon
2006-03-02T21:11:09Z

[-- Attachment #1: Type: text/plain, Size: 4029 bytes --]

On Wed, 1 Mar 2006 20:51:38 -0800, Andrew Morton <akpm@osdl.org> wrote:

> "J.A. Magallon" <jamagallon@able.es> wrote:
> >
> > On Wed, 1 Mar 2006 02:32:35 -0800, Andrew Morton <akpm@osdl.org> wrote:
> >
> > >
> > > Useful, thanks. So the second batch of /proc patches are indeed the problem.
> > >
> > > If you have (even more) time you could test
> > > http://www.zip.com.au/~akpm/linux/patches/stuff/2.6.16-rc5-mm2-pre1.gz.
> > > That's the latest of everything with the problematic sysfs patches reverted
> > > and Eric's recent /proc fixes.
> > >
> >
> > I just tried rc5-mm1 and this. With this I can run java apps/applets again
> > without locking my system.
> >
> > I also applied the patch you posted for inotify, but now I get this new one:
> >
> > Mar 1 15:11:04 werewolf kernel: [ 1424.891482] BUG: warning at fs/inotify.c:410/set_dentry_child_flags()
>
> Which patch was that? The first one was doubly broken.
>
> This is closer.
>
> diff -puN fs/dcache.c~inotify-lock-avoidance-with-parent-watch-status-in-dentry-fix fs/dcache.c
> --- devel/fs/dcache.c~inotify-lock-avoidance-with-parent-watch-status-in-dentry-fix 2006-03-01 12:16:22.000000000 -0800
> +++ devel-akpm/fs/dcache.c 2006-03-01 12:18:34.000000000 -0800
> @@ -100,6 +100,7 @@ static void dentry_iput(struct dentry *
> if (inode) {
> dentry->d_inode = NULL;
> list_del_init(&dentry->d_alias);
> + dentry->d_flags &= ~DCACHE_INOTIFY_PARENT_WATCHED;
> spin_unlock(&dentry->d_lock);
> spin_unlock(&dcache_lock);
> if (!inode->i_nlink)
> _
>
>

What I have collected till now is below (against -mm2-pre1). What is
(not) needed from this ? Thanks...

--- devel/fs/inotify.c~a 2006-03-01 02:47:01.000000000 -0800
+++ devel-akpm/fs/inotify.c 2006-03-01 02:47:06.000000000 -0800
@@ -390,6 +390,7 @@ static inline int inotify_inode_watched(

/*
* Get child dentry flag into synch with parent inode.
+ * Flag should always be clear for negative dentrys.
*/
static void set_dentry_child_flags(struct inode *inode, int watched)
{
@@ -400,14 +401,14 @@ static void set_dentry_child_flags(struc
struct dentry *child;

list_for_each_entry(child, &alias->d_subdirs, d_u.d_child) {
+ if (!child->d_inode) {
+ WARN_ON(child->d_flags & DCACHE_INOTIFY_PARENT_WATCHED);
+ continue;
+ }
spin_lock(&child->d_lock);
if (watched) {
- WARN_ON(child->d_flags &
- DCACHE_INOTIFY_PARENT_WATCHED);
child->d_flags |= DCACHE_INOTIFY_PARENT_WATCHED;
} else {
- WARN_ON(!(child->d_flags &
- DCACHE_INOTIFY_PARENT_WATCHED));
child->d_flags&=~DCACHE_INOTIFY_PARENT_WATCHED;
}
spin_unlock(&child->d_lock);
@@ -530,7 +530,6 @@ void inotify_d_instantiate(struct dentry
if (!inode)
return;

- WARN_ON(entry->d_flags & DCACHE_INOTIFY_PARENT_WATCHED);
spin_lock(&entry->d_lock);
parent = entry->d_parent;
if (inotify_inode_watched(parent->d_inode))
--- linux-2.6.orig/fs/dcache.c
+++ linux-2.6/fs/dcache.c
@@ -100,6 +100,7 @@ static void dentry_iput(struct dentry *
if (inode) {
dentry->d_inode = NULL;
list_del_init(&dentry->d_alias);
+ dentry->d_flags &= ~DCACHE_INOTIFY_PARENT_WATCHED;
spin_unlock(&dentry->d_lock);
spin_unlock(&dcache_lock);
if (!inode->i_nlink)
@@ -1203,6 +1204,9 @@ void d_delete(struct dentry * dentry)
spin_lock(&dentry->d_lock);
isdir = S_ISDIR(dentry->d_inode->i_mode);
if (atomic_read(&dentry->d_count) == 1) {
+ /* remove this and other inotify debug checks after 2.6.18 */
+ dentry->d_flags &= ~DCACHE_INOTIFY_PARENT_WATCHED;
+
dentry_iput(dentry);
fsnotify_nameremove(dentry, isdir);
return;

--
J.A. Magallon <jamagallon()able!es> \ Software is like sex:
werewolf!able!es \ It's better when it's free
Mandriva Linux release 2006.1 (Cooker) for i586
Linux 2.6.15-jam14 (gcc 4.0.3 (4.0.3-0.20060215.2mdk for Mandriva Linux release 2006.1))

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 191 bytes --]