Jason Lunz:
> I'm running aufs 20061126 on linux i386 2.6.22.14. The machine I'm using
> now is a vmware VM with 2 CPUs, but I've also reproduced similar crashes
> on real x86 hardware with older aufs versions.

I think it is a race condition in revalidating a dentry.
Will you try this patch?

Junjiro Okajima

----------------------------------------------------------------------
diff -x CVS -x RCS -x .pdiff -rup ../../aufs.anon/aufs/fs/aufs/dentry.c 
./fs/aufs/dentry.c
--- ../../aufs.anon/aufs/fs/aufs/dentry.c       2007-11-12 10:43:52.000000000 
+0900
+++ ./fs/aufs/dentry.c  2007-11-28 12:53:34.278509424 +0900
@@ -726,21 +726,20 @@ int au_refresh_hdentry(struct dentry *de
        return npositive;
 }
 
-static int h_d_revalidate(struct dentry *dentry, struct nameidata *nd,
-                         int do_udba)
+static int h_d_revalidate(struct dentry *dentry, struct inode *inode,
+                         struct nameidata *nd, int do_udba)
 {
        int err, plus, locked, unhashed, is_root, h_plus, valid;
        struct nameidata fake_nd, *p;
        aufs_bindex_t bindex, btail, bstart, ibs, ibe;
        struct super_block *sb;
-       struct inode *inode, *first, *h_inode, *h_cached_inode;
+       struct inode *first, *h_inode, *h_cached_inode;
        umode_t mode, h_mode;
        struct dentry *h_dentry;
        int (*reval)(struct dentry *, struct nameidata *);
        struct qstr *name;
 
        LKTRTrace("%.*s, nd %d\n", AuDLNPair(dentry), !!nd);
-       inode = dentry->d_inode;
        AuDebugOn(inode && au_digen(dentry) != au_iigen(inode));
 
        err = 0;
@@ -1101,7 +1100,7 @@ static int aufs_d_revalidate(struct dent
            && au_test_higen(inode, au_h_iptr(inode)))
                goto out;
        ndp = au_dup_nd(sbinfo, &tmp_nd, nd);
-       err = h_d_revalidate(dentry, ndp, do_udba);
+       err = h_d_revalidate(dentry, inode, ndp, do_udba);
        //err = -1;
 
  out:
@@ -1115,7 +1114,10 @@ static int aufs_d_revalidate(struct dent
 #endif
        au_store_fmode_exec(nd, inode);
 
-       aufs_read_unlock(dentry, AuLock_IR);
+       if (inode)
+               ii_read_unlock(inode);
+       di_read_unlock(dentry, !AuLock_IR);
+       si_read_unlock(sb);
        AuTraceErr(err);
        valid = !err;
        if (!valid)
 

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4

Reply via email to