"Jrgen_P._Tjern":
> I had a kernel BUG today, using a slightly old AUFS (20070917). It seems
> to have been caused by glftpd (an ftp daemon), while I was uploading
> files. I believe it happened during (or after) a file transfer, not an
> mkdir. Here's the dmesg output: (I'll upgrade my aufs soon)

The aufs version you are using is not old.
Because your kernel is 2.6.20.3, I don't think the newer aufs is not
important for you.

The bug you met is interesting to me.
The line dentry.c:737 shows the problem is related to the branch
management of aufs. It might be an SMP specific problem. But I am not
sure. Did you remount,del or add while you were uploading?
Won't you try this patch against 20070917?


Junjiro Okajima
----------------------------------------------------------------------
Index: fs/aufs/branch.c
===================================================================
RCS file: /cvsroot/aufs/aufs/fs/aufs/branch.c,v
retrieving revision 1.59
diff -u -p -r1.59 branch.c
--- fs/aufs/branch.c    17 Sep 2007 03:24:00 -0000      1.59
+++ fs/aufs/branch.c    25 Sep 2007 16:44:21 -0000
@@ -539,6 +539,7 @@ int br_add(struct super_block *sb, struc
        add_branch->br_perm = add->perm;
        atomic_set(&add_branch->br_count, 0);
        add_branch->br_generation = au_sigen(sb);
+       smp_mb(); /* atomic_set */
 
        sbinfo = stosi(sb);
        dinfo = dtodi(root);
Index: fs/aufs/dinfo.c
===================================================================
RCS file: /cvsroot/aufs/aufs/fs/aufs/dinfo.c,v
retrieving revision 1.30
diff -u -p -r1.30 dinfo.c
--- fs/aufs/dinfo.c     17 Sep 2007 03:24:44 -0000      1.30
+++ fs/aufs/dinfo.c     25 Sep 2007 16:44:21 -0000
@@ -42,6 +42,7 @@ int au_alloc_dinfo(struct dentry *dentry
                //{kfree(dinfo->di_hdentry); dinfo->di_hdentry = NULL;}
                if (dinfo->di_hdentry) {
                        atomic_set(&dinfo->di_generation, au_sigen(sb));
+                       smp_mb(); /* atomic_set */
                        rw_init_wlock_nested(&dinfo->di_rwsem, AuLsc_DI_PARENT);
                        dinfo->di_bstart = dinfo->di_bend = -1;
                        dinfo->di_bwh = dinfo->di_bdiropq = -1;
@@ -385,7 +386,7 @@ void au_update_digen(struct dentry *dent
        //DiMustWriteLock(dentry);
        AuDebugOn(!dentry->d_sb);
        atomic_set(&dtodi(dentry)->di_generation, au_sigen(dentry->d_sb));
-       //smp_mb();
+       smp_mb(); /* atomic_set */
 }
 
 void au_update_dbstart(struct dentry *dentry)
Index: fs/aufs/finfo.c
===================================================================
RCS file: /cvsroot/aufs/aufs/fs/aufs/finfo.c,v
retrieving revision 1.26
diff -u -p -r1.26 finfo.c
--- fs/aufs/finfo.c     2 Jul 2007 05:12:15 -0000       1.26
+++ fs/aufs/finfo.c     25 Sep 2007 16:44:21 -0000
@@ -144,7 +144,7 @@ void set_h_fptr(struct file *file, aufs_
 void au_update_figen(struct file *file)
 {
        atomic_set(&ftofi(file)->fi_generation, au_digen(file->f_dentry));
-       //smp_mb();
+       smp_mb(); /* atomic_set */
 }
 
 void au_fin_finfo(struct file *file)
@@ -200,6 +200,7 @@ int au_init_finfo(struct file *file)
                        finfo->fi_bstart = -1;
                        finfo->fi_bend = -1;
                        atomic_set(&finfo->fi_generation, au_digen(dentry));
+                       smp_mb(); /* atomic_set */
 
                        file->private_data = finfo;
                        return 0; /* success */
Index: fs/aufs/iinfo.c
===================================================================
RCS file: /cvsroot/aufs/aufs/fs/aufs/iinfo.c,v
retrieving revision 1.38
diff -u -p -r1.38 iinfo.c
--- fs/aufs/iinfo.c     15 Jul 2007 20:04:47 -0000      1.38
+++ fs/aufs/iinfo.c     25 Sep 2007 16:44:21 -0000
@@ -213,7 +213,7 @@ void au_update_iigen(struct inode *inode
        //IiMustWriteLock(inode);
        AuDebugOn(!inode->i_sb);
        atomic_set(&itoii(inode)->ii_generation, au_sigen(inode->i_sb));
-       //smp_mb();
+       smp_mb(); /* atomic_set */
 }
 
 /* it may be called at remount time, too */
@@ -276,6 +276,7 @@ int au_iinfo_init(struct inode *inode)
                for (i = 0; i < nbr; i++)
                        iinfo->ii_hinode[i].hi_id = -1;
                atomic_set(&iinfo->ii_generation, au_sigen(sb));
+               smp_mb(); /* atomic_set */
                rw_init_nolock(&iinfo->ii_rwsem);
                iinfo->ii_bstart = -1;
                iinfo->ii_bend = -1;
Index: fs/aufs/wkq.c
===================================================================
RCS file: /cvsroot/aufs/aufs/fs/aufs/wkq.c,v
retrieving revision 1.21
diff -u -p -r1.21 wkq.c
--- fs/aufs/wkq.c       3 Sep 2007 03:44:26 -0000       1.21
+++ fs/aufs/wkq.c       25 Sep 2007 16:44:21 -0000
@@ -303,6 +303,7 @@ int __init au_wkq_init(void)
        atomic_set(&nowaitq->busy, 0);
        nowaitq->max_busy = 0;
        nowaitq->q = NULL;
+       smp_mb(); /* atomic_set */
 
 #if 0 // test accouting
        if (!err) {

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

Reply via email to