UBUNTU: ubuntu: AUFS -- update to b1cee06249dfa0ab30951e7f06490a75c155b620
authorAndy Whitcroft <apw@canonical.com>
Thu, 27 Jan 2011 11:33:32 +0000 (11:33 +0000)
committerLeann Ogasawara <leann.ogasawara@canonical.com>
Mon, 28 Mar 2011 13:53:23 +0000 (06:53 -0700)
    commit b1cee06249dfa0ab30951e7f06490a75c155b620
    Author: J. R. Okajima <hooanon05@yahoo.co.jp>
    Date:   Sun Jan 23 23:06:51 2011 +0900

        aufs: for 2.6.38-rcN, testing, revert stop_sillyrename

Signed-off-by: J. R. Okajima <hooanon05@yahoo.co.jp>

    commit fb742969486f39f4a7a6f0859758a42189bd38d0
    Author: J. R. Okajima <hooanon05@yahoo.co.jp>
    Date:   Fri Jan 21 16:13:16 2011 +0900

        aufs: for 2.6.38-rcN, use a new member s_d_op

Signed-off-by: J. R. Okajima <hooanon05@yahoo.co.jp>

    commit 6e91ff14940eeaf587dd0386a31e1f0c718ded1d
    Author: J. R. Okajima <hooanon05@yahoo.co.jp>
    Date:   Fri Jan 21 16:14:03 2011 +0900

        aufs: for 2.6.38-rcN, tiny, just a comment

Signed-off-by: J. R. Okajima <hooanon05@yahoo.co.jp>

    commit 0cbbdfb0411cc28445761990079c929946f0b3b2
    Author: J. R. Okajima <hooanon05@yahoo.co.jp>
    Date:   Fri Jan 21 16:02:21 2011 +0900

        aufs: for 2.6.38-rcN, force write lock for rename_lock

        Because au_dcsub_pages() cannot discard the intermediate result and
        restart the traversal, always write_lock.

Signed-off-by: J. R. Okajima <hooanon05@yahoo.co.jp>

    commit 742f879080f69bd1c5bf428f74fefb1b6e38565e
    Author: J. R. Okajima <hooanon05@yahoo.co.jp>
    Date:   Fri Jan 21 16:12:01 2011 +0900

        aufs: for 2.6.38-rcN, protect d_unhashed() by d_lock

Signed-off-by: J. R. Okajima <hooanon05@yahoo.co.jp>

    commit 90ea0a0815b44e919737de424bce249c817ebbd6
    Author: J. R. Okajima <hooanon05@yahoo.co.jp>
    Date:   Sat Jan 22 16:17:28 2011 +0900

        aufs: possible bugfix, protect d_unhashed() by di_write_lock

Signed-off-by: J. R. Okajima <hooanon05@yahoo.co.jp>

    commit 7489e85817cc5154c35664c794041c2582590616
    Author: J. R. Okajima <hooanon05@yahoo.co.jp>
    Date:   Fri Jan 21 15:58:59 2011 +0900

        aufs: tiny, replace au_d_removed() by d_unlinked()

        These two small functions are identical.

Signed-off-by: J. R. Okajima <hooanon05@yahoo.co.jp>

    commit 97bf43fd682b2c9aaa74eba39a405f669b4c3b31
    Author: J. R. Okajima <hooanon05@yahoo.co.jp>
    Date:   Fri Jan 21 16:15:12 2011 +0900

        aufs: testing, stop unhashing in hnotify

        In aufs, all hash/unhash for dentries should follow VFS.

Signed-off-by: J. R. Okajima <hooanon05@yahoo.co.jp>

    commit f1fdfd580181ae75af84d347aa13c7b3f632a7e5
    Author: J. R. Okajima <hooanon05@yahoo.co.jp>
    Date:   Fri Jan 21 16:00:14 2011 +0900

        aufs: tiny, modify a comment

Signed-off-by: J. R. Okajima <hooanon05@yahoo.co.jp>

Signed-off-by: Andy Whitcroft <apw@canonical.com>

14 files changed:
ubuntu/aufs/BOM
ubuntu/aufs/branch.c
ubuntu/aufs/dcsub.c
ubuntu/aufs/dcsub.h
ubuntu/aufs/dentry.c
ubuntu/aufs/dinfo.c
ubuntu/aufs/file.c
ubuntu/aufs/hnotify.c
ubuntu/aufs/i_op.c
ubuntu/aufs/module.c
ubuntu/aufs/super.c
ubuntu/aufs/sysrq.c
ubuntu/aufs/vfsub.c
ubuntu/include/linux/aufs_type.h

index 2884962..2b80325 100644 (file)
@@ -1,2 +1,2 @@
 URL: http://git.c3sl.ufpr.br/pub/scm/aufs/aufs2-standalone.git
-COMMIT: 806051bcbeec27748aae2b7957726a4e63ff308e
+COMMIT: b1cee06249dfa0ab30951e7f06490a75c155b620
index 450ee7f..e5e222e 100644 (file)
@@ -504,7 +504,7 @@ int au_br_add(struct super_block *sb, struct au_opt_add *add, int remount)
 
        /*
         * this test/set prevents aufs from handling unnecesary notify events
-        * of xino files, in a case of re-adding a writable branch which was
+        * of xino files, in case of re-adding a writable branch which was
         * once detached from aufs.
         */
        if (au_xino_brid(sb) < 0
index 0fde88b..8696873 100644 (file)
@@ -109,15 +109,13 @@ out:
 int au_dcsub_pages(struct au_dcsub_pages *dpages, struct dentry *root,
                   au_dpages_test test, void *arg)
 {
-       int err, locked = 0;
-       unsigned int seq;
+       int err;
        struct dentry *this_parent;
        struct list_head *next;
        struct super_block *sb = root->d_sb;
 
        err = 0;
-       seq = read_seqbegin(&rename_lock);
-again:
+       write_seqlock(&rename_lock);
        this_parent = root;
        spin_lock(&this_parent->d_lock);
 repeat:
@@ -166,14 +164,6 @@ resume:
                child = this_parent;
                this_parent = tmp;
                spin_lock(&this_parent->d_lock);
-               /* might go back up the wrong parent if we have had a rename
-                * or deletion */
-               if (this_parent != child->d_parent ||
-                   (!locked && read_seqretry(&rename_lock, seq))) {
-                       spin_unlock(&this_parent->d_lock);
-                       rcu_read_unlock();
-                       goto rename_retry;
-               }
                rcu_read_unlock();
                next = child->d_u.d_child.next;
                goto resume;
@@ -181,17 +171,8 @@ resume:
 
 out:
        spin_unlock(&this_parent->d_lock);
-       if (!locked) {
-               if (!err && read_seqretry(&rename_lock, seq))
-                       goto rename_retry;
-       } else
-               write_sequnlock(&rename_lock);
+       write_sequnlock(&rename_lock);
        return err;
-
-rename_retry:
-       locked = 1;
-       write_seqlock(&rename_lock);
-       goto again;
 }
 
 int au_dcsub_pages_rev(struct au_dcsub_pages *dpages, struct dentry *dentry,
index acab939..1211304 100644 (file)
@@ -57,11 +57,6 @@ int au_test_subdir(struct dentry *d1, struct dentry *d2);
 
 /* ---------------------------------------------------------------------- */
 
-static inline int au_d_removed(struct dentry *d)
-{
-       return !IS_ROOT(d) && d_unhashed(d);
-}
-
 static inline int au_d_hashed_positive(struct dentry *d)
 {
        int err;
@@ -81,7 +76,7 @@ static inline int au_d_alive(struct dentry *d)
                err = au_d_hashed_positive(d);
        else {
                inode = d->d_inode;
-               if (unlikely(au_d_removed(d) || !inode || !inode->i_nlink))
+               if (unlikely(d_unlinked(d) || !inode || !inode->i_nlink))
                        err = -ENOENT;
        }
        return err;
index 84d530e..b8614ad 100644 (file)
@@ -912,7 +912,7 @@ static int h_d_revalidate(struct dentry *dentry, struct inode *inode,
                        continue;
 
                AuDbg("b%d, %.*s\n", bindex, AuDLNPair(h_dentry));
-               /* spin_lock(&h_dentry->d_lock); */
+               spin_lock(&h_dentry->d_lock);
                h_name = &h_dentry->d_name;
                if (unlikely(do_udba
                             && !is_root
@@ -923,10 +923,10 @@ static int h_d_revalidate(struct dentry *dentry, struct inode *inode,
                        AuDbg("unhash 0x%x 0x%x, %.*s %.*s\n",
                                  unhashed, d_unhashed(h_dentry),
                                  AuDLNPair(dentry), AuDLNPair(h_dentry));
-                       /* spin_unlock(&h_dentry->d_lock); */
+                       spin_unlock(&h_dentry->d_lock);
                        goto err;
                }
-               /* spin_unlock(&h_dentry->d_lock); */
+               spin_unlock(&h_dentry->d_lock);
 
                err = au_do_h_d_reval(h_dentry, nd, dentry, bindex);
                if (unlikely(err))
index 9454542..1786442 100644 (file)
@@ -128,7 +128,6 @@ int au_di_init(struct dentry *dentry)
        if (dinfo) {
                atomic_set(&dinfo->di_generation, au_sigen(sb));
                /* smp_mb(); */ /* atomic_set */
-               d_set_d_op(dentry, &aufs_dop);
                dentry->d_fsdata = dinfo;
        } else
                err = -ENOMEM;
index 4b6c4b2..27785dd 100644 (file)
@@ -54,10 +54,13 @@ struct file *au_h_open(struct dentry *dentry, aufs_bindex_t bindex, int flags,
        h_inode = h_dentry->d_inode;
        if (au_test_nfsd() && !h_inode)
                goto out;
-       if (unlikely((!d_unhashed(dentry) && au_d_removed(h_dentry))
-                    || !h_inode
-                    /* || !dentry->d_inode->i_nlink */
-                   ))
+       spin_lock(&h_dentry->d_lock);
+       err = (!d_unhashed(dentry) && d_unlinked(h_dentry))
+               || !h_inode
+               /* || !dentry->d_inode->i_nlink */
+               ;
+       spin_unlock(&h_dentry->d_lock);
+       if (unlikely(err))
                goto out;
 
        sb = dentry->d_sb;
@@ -461,7 +464,7 @@ static void au_do_refresh_dir(struct file *file)
        }
 
        p = fidir->fd_hfile;
-       if (!au_test_mmapped(file) && !au_d_removed(file->f_dentry)) {
+       if (!au_test_mmapped(file) && !d_unlinked(file->f_dentry)) {
                bend = au_sbend(sb);
                for (finfo->fi_btop = 0; finfo->fi_btop <= bend;
                     finfo->fi_btop++, p++)
@@ -525,7 +528,7 @@ static int refresh_file(struct file *file, int (*reopen)(struct file *file))
        need_reopen = 1;
        if (!au_test_mmapped(file))
                err = au_file_refresh_by_inode(file, &need_reopen);
-       if (!err && need_reopen && !au_d_removed(dentry))
+       if (!err && need_reopen && !d_unlinked(dentry))
                err = reopen(file);
        if (!err) {
                au_update_figen(file);
index 5eb51fa..7094a07 100644 (file)
@@ -182,9 +182,11 @@ static int hn_gen_tree(struct dentry *dentry)
 out_dpages:
        au_dpages_free(&dpages);
 
+#if 0
        /* discard children */
        dentry_unhash(dentry);
        dput(dentry);
+#endif
 out:
        return err;
 }
index aba296e..62699e0 100644 (file)
@@ -571,7 +571,7 @@ static int au_pin_and_icpup(struct dentry *dentry, struct iattr *ia,
 
        h_file = NULL;
        hi_wh = NULL;
-       if (au_ftest_icpup(a->flags, DID_CPUP) && au_d_removed(dentry)) {
+       if (au_ftest_icpup(a->flags, DID_CPUP) && d_unlinked(dentry)) {
                hi_wh = au_hi_wh(inode, a->btgt);
                if (!hi_wh) {
                        err = au_sio_cpup_wh(dentry, a->btgt, sz, /*file*/NULL);
@@ -662,10 +662,10 @@ static int aufs_setattr(struct dentry *dentry, struct iattr *ia)
        } else {
                /* fchmod() doesn't pass ia_file */
                a->udba = au_opt_udba(sb);
-               /* no au_d_removed(), to set UDBA_NONE for root */
+               di_write_lock_child(dentry);
+               /* no d_unlinked(), to set UDBA_NONE for root */
                if (d_unhashed(dentry))
                        a->udba = AuOpt_UDBA_NONE;
-               di_write_lock_child(dentry);
                if (a->udba != AuOpt_UDBA_NONE) {
                        AuDebugOn(IS_ROOT(dentry));
                        err = au_reval_for_attr(dentry, au_sigen(sb));
@@ -778,7 +778,7 @@ static int aufs_getattr(struct vfsmount *mnt __maybe_unused,
        udba_none = !!au_opt_test(mnt_flags, UDBA_NONE);
 
        /* support fstat(2) */
-       if (!au_d_removed(dentry) && !udba_none) {
+       if (!d_unlinked(dentry) && !udba_none) {
                unsigned int sigen = au_sigen(sb);
                err = au_digen_test(dentry, sigen);
                if (!err) {
index 1d81c64..9d84d06 100644 (file)
@@ -45,6 +45,7 @@ static int __init au_cache_init(void)
 {
        au_cachep[AuCache_DINFO] = AuCacheCtor(au_dinfo, au_di_init_once);
        if (au_cachep[AuCache_DINFO])
+               /* SLAB_DESTROY_BY_RCU */
                au_cachep[AuCache_ICNTNR] = AuCacheCtor(au_icntnr,
                                                        au_icntnr_init_once);
        if (au_cachep[AuCache_ICNTNR])
index 3776125..d5e0cd5 100644 (file)
@@ -816,6 +816,7 @@ static int aufs_fill_super(struct super_block *sb, void *raw_data,
        /* all timestamps always follow the ones on the branch */
        sb->s_flags |= MS_NOATIME | MS_NODIRATIME;
        sb->s_op = &aufs_sop;
+       sb->s_d_op = &aufs_dop;
        sb->s_magic = AUFS_SUPER_MAGIC;
        sb->s_maxbytes = 0;
        au_export_init(sb);
index 12f6b23..99589d3 100644 (file)
@@ -60,7 +60,6 @@ static void sysrq_sb(struct super_block *sb)
                err = au_dpages_init(&dpages, GFP_ATOMIC);
                if (unlikely(err))
                        break;
-               /* no way, it requires si write lock */
                err = au_dcsub_pages(&dpages, sb->s_root, NULL, NULL);
                if (!err)
                        for (i = 0; i < dpages.ndpage; i++) {
index 76a6c79..6ce2fd5 100644 (file)
@@ -729,7 +729,8 @@ static void call_unlink(void *args)
        struct unlink_args *a = args;
        struct dentry *d = a->path->dentry;
        struct inode *h_inode;
-       const int stop_sillyrename = au_test_nfs(d->d_sb);
+       const int stop_sillyrename = (au_test_nfs(d->d_sb)
+                                     && d->d_count == 1);
 
        IMustLock(a->dir);
 
index 6b9d194..160b0b6 100644 (file)
@@ -24,7 +24,7 @@
 #include <linux/limits.h>
 #include <linux/types.h>
 
-#define AUFS_VERSION   "2.1-standalone.tree-38-rcN-20110117"
+#define AUFS_VERSION   "2.1-standalone.tree-38-rcN-20110124"
 
 /* todo? move this to linux-2.6.19/include/magic.h */
 #define AUFS_SUPER_MAGIC       ('a' << 24 | 'u' << 16 | 'f' << 8 | 's')