> BUG at /root/aufs.wcvs/aufs/fs/aufs/super.c:357! > must be a bug in aufs. I will fix it as soon as possible.
Please apply this patch, which is against the latest source in CVS. If you success, it will be included in next release. This patch is only for BUG at super.c:357 only. Junjiro Okajima ---------------------------------------------------------------------- Index: fs/aufs/branch.c =================================================================== RCS file: /cvsroot/aufs/aufs/fs/aufs/branch.c,v retrieving revision 1.42 diff -u -p -r1.42 branch.c --- fs/aufs/branch.c 19 Mar 2007 04:29:53 -0000 1.42 +++ fs/aufs/branch.c 19 Mar 2007 11:55:53 -0000 @@ -474,7 +474,7 @@ int br_add(struct super_block *sb, struc maxb = add->nd.dentry->d_sb->s_maxbytes; if (sb->s_maxbytes < maxb) sb->s_maxbytes = maxb; - au_sigen_inc(sb); + //au_sigen_inc(sb); if (IS_MS(sb, MS_XINO)) { struct file *base_file = stobr(sb, 0)->br_xino; @@ -657,7 +657,7 @@ int br_del(struct super_block *sb, struc sbinfo->si_bend--; dinfo->di_bend--; iinfo->ii_bend--; - au_sigen_inc(sb); + //au_sigen_inc(sb); if (!bindex) au_cpup_attr_all(inode); else @@ -696,6 +696,21 @@ int br_del(struct super_block *sb, struc return err; } +static int do_need_sigen_inc(unsigned int a, unsigned int b) +{ + return (is_whable(a) && !is_whable(b)); +} + +static int need_sigen_inc(unsigned int old, unsigned int new) +{ + return (do_need_sigen_inc(old, new) + || do_need_sigen_inc(new, old)); +} + +/* + * returns tri-status. + * plus means the si_generation needs to be incremented later. + */ int br_mod(struct super_block *sb, struct opt_mod *mod, int remount) { int err; @@ -783,10 +798,9 @@ int br_mod(struct super_block *sb, struc goto out; } + err = need_sigen_inc(br->br_perm, mod->perm); br->br_perm = mod->perm; - // no need to inc? - //au_sigen_inc(sb); - return 0; /* success */ + return err; /* success */ out: TraceErr(err); Index: fs/aufs/branch.h =================================================================== RCS file: /cvsroot/aufs/aufs/fs/aufs/branch.h,v retrieving revision 1.25 diff -u -p -r1.25 branch.h --- fs/aufs/branch.h 19 Mar 2007 04:30:30 -0000 1.25 +++ fs/aufs/branch.h 19 Mar 2007 11:55:53 -0000 @@ -64,6 +64,9 @@ struct aufs_branch { #define sbr_perm(sb, bindex) ({stobr(sb, bindex)->br_perm;}) #define sbr_perm_str(sb, bindex, str, len) \ br_perm_str(str, len, stobr(sb, bindex)->br_perm) +#define is_whable(perm) (perm & (MAY_WRITE | AUFS_MAY_WH)) +#define sbr_is_whable(sb, bindex) \ + is_whable(sbr_perm(sb, bindex)) #define br_wh_read_lock(br) rw_read_lock(&(br)->br_wh_rwsem, AUFS_LSC_BR_WH) #define br_wh_read_unlock(br) rw_read_unlock(&(br)->br_wh_rwsem) Index: fs/aufs/dentry.c =================================================================== RCS file: /cvsroot/aufs/aufs/fs/aufs/dentry.c,v retrieving revision 1.34 diff -u -p -r1.34 dentry.c --- fs/aufs/dentry.c 19 Mar 2007 04:31:31 -0000 1.34 +++ fs/aufs/dentry.c 19 Mar 2007 11:55:53 -0000 @@ -158,7 +158,7 @@ static struct dentry *do_lookup(struct d wh_found = 0; sb = dentry->d_sb; - wh_able = (sbr_perm(sb, bindex) & (MAY_WRITE | AUFS_MAY_WH)); + wh_able = sbr_is_whable(sb, bindex); lkup.nfsmnt = mnt_nfs(sb, bindex); name = &dentry->d_name; if (unlikely(wh_able)) { @@ -474,8 +474,16 @@ int au_refresh_hdentry(struct dentry *de } } - dinfo->di_bwh = bwh; - dinfo->di_bdiropq = bdiropq; + dinfo->di_bwh = -1; + if (unlikely(bwh != -1 + && bwh <= sbend(sb) + && sbr_is_whable(sb, bwh))) + dinfo->di_bwh = bwh; + dinfo->di_bdiropq = -1; + if (unlikely(bdiropq != -1 + && bdiropq <= sbend(sb) + && sbr_is_whable(sb, bdiropq))) + dinfo->di_bdiropq = bdiropq; parent_bend = dbend(parent); p = dinfo->di_hdentry; for (bindex = 0; bindex <= parent_bend; bindex++, p++) Index: fs/aufs/opts.c =================================================================== RCS file: /cvsroot/aufs/aufs/fs/aufs/opts.c,v retrieving revision 1.28 diff -u -p -r1.28 opts.c --- fs/aufs/opts.c 19 Mar 2007 04:32:35 -0000 1.28 +++ fs/aufs/opts.c 19 Mar 2007 11:55:53 -0000 @@ -715,7 +715,7 @@ int parse_opts(struct super_block *sb, c int do_opts(struct super_block *sb, struct opts *opts, int remount) { - int err; + int err, do_sigen; struct opt *opt; struct aufs_sbinfo *sbinfo; struct inode *dir; @@ -735,10 +735,12 @@ int do_opts(struct super_block *sb, stru } err = 0; + do_sigen = 0; if (opts->xino.path) { err = xino_set(sb, &opts->xino, remount); if (unlikely(err)) goto out; + do_sigen++; } sbinfo = stosi(sb); @@ -747,22 +749,34 @@ int do_opts(struct super_block *sb, stru switch (opt->type) { case Opt_add: err = br_add(sb, &opt->add, remount); + if (!err) + do_sigen++; break; case Opt_del: case Opt_idel: err = br_del(sb, &opt->del, remount); + if (!err) + do_sigen++; break; case Opt_mod: case Opt_imod: err = br_mod(sb, &opt->mod, remount); + if (err > 0) { + do_sigen++; + err = 0; + } break; case Opt_append: opt->add.bindex = sbend(sb) + 1; err = br_add(sb, &opt->add, remount); + if (!err) + do_sigen++; break; case Opt_prepend: opt->add.bindex = 0; err = br_add(sb, &opt->add, remount); + if (!err) + do_sigen++; break; case Opt_dirwh: @@ -797,6 +811,7 @@ int do_opts(struct super_block *sb, stru case Opt_udba: /* set it later */ udba = opt->udba; + do_sigen++; break; case Opt_diropq_a: @@ -836,6 +851,9 @@ int do_opts(struct super_block *sb, stru && !(stobr(sb, 0)->br_perm & MAY_WRITE))) Warn("first branch should be rw\n"); + if (do_sigen) + au_sigen_inc(sb); + udba_set(sb, udba); /* AUFS_HI_XINO will be handled later */ if (unlikely(udba == MS_UDBA_INOTIFY && ibend(dir) >= 0)) ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV