aboutsummaryrefslogtreecommitdiff
path: root/ubuntu/aufs
diff options
context:
space:
mode:
authorAndy Whitcroft <apw@canonical.com>2011-01-17 14:14:49 +0000
committerJohn Rigby <john.rigby@linaro.org>2011-09-23 08:48:05 -0600
commit8f2076839457d6ef780cf711312b28dab6832565 (patch)
tree6233852036f20589519bc9978113c17923513e39 /ubuntu/aufs
parent83e2734e622f8d4078117a2b3514deb04f2683ca (diff)
UBUNTU: ubuntu: AUFS -- update to 806051bcbeec27748aae2b7957726a4e63ff308e
commit 806051bcbeec27748aae2b7957726a4e63ff308e Author: J. R. Okajima <hooanon05@yahoo.co.jp> Date: Fri Jan 14 16:05:18 2011 +0900 aufs: follow the changes in 2.6.38-rcN, testing This work is not done yet. - review is required for aufs code. - there are several known problems in mainline which are being fixed now. Signed-off-by: J. R. Okajima <hooanon05@yahoo.co.jp> commit f996d6b1adcd2c677c818fdf453ba257660f74c0 Author: J. R. Okajima <hooanon05@yahoo.co.jp> Date: Mon Jan 10 17:32:50 2011 +0900 aufs: bugfix, valid ptr in radix tree instead of dummy 1 When a process whose pid is larger than 32768 (default), si_pid_set_slow() crashes due to a dummy value. Replace the value by a valid pointer. Reported-by: P.L.H.Bloom@tudelft.nl Signed-off-by: J. R. Okajima <hooanon05@yahoo.co.jp> commit fb2bbc5fddc96fe90ae86f29dbcb104c224f1831 Author: J. R. Okajima <hooanon05@yahoo.co.jp> Date: Mon Jan 10 13:11:51 2011 +0900 aufs: tiny, version string for aufs2.1-38-rcN Signed-off-by: J. R. Okajima <hooanon05@yahoo.co.jp> commit 1cbb90f7fc05ea86e872191bc4bc3422d7ef6401 Author: J. R. Okajima <hooanon05@yahoo.co.jp> Date: Mon Jan 10 11:07:29 2011 +0900 aufs: tiny, version string for aufs2.1-37 Signed-off-by: J. R. Okajima <hooanon05@yahoo.co.jp> commit 795be8aa5ea8ac132e4ad4a0e9f1a0e33b9cd692 Author: J. R. Okajima <hooanon05@yahoo.co.jp> Date: Sat Jan 8 02:07:07 2011 +0900 aufs: tiny, describe installing in aufs2-standalone.git Signed-off-by: J. R. Okajima <hooanon05@yahoo.co.jp> commit 3714bfd727bb7afbfe9a1e8eee8f6aefcc0f4e58 Author: J. R. Okajima <hooanon05@yahoo.co.jp> Date: Fri Jan 7 12:25:06 2011 +0900 aufs: tiny, new year in copyright Signed-off-by: J. R. Okajima <hooanon05@yahoo.co.jp> commit 6a9bf4a4ebf0c4a5e694de2952d36e576b051692 Author: J. R. Okajima <hooanon05@yahoo.co.jp> Date: Fri Jan 7 12:21:14 2011 +0900 aufs: tiny, new year in copyright Signed-off-by: J. R. Okajima <hooanon05@yahoo.co.jp> commit 7c771c6f660d9e0f17def9550e396418589e4340 Author: J. R. Okajima <hooanon05@yahoo.co.jp> Date: Fri Jan 7 12:03:19 2011 +0900 aufs: tiny, describe union-mount and dm-snapshot Signed-off-by: J. R. Okajima <hooanon05@yahoo.co.jp> commit 05a6d7153c58c13bca10ef7eb19ef3e3832d1c40 Author: J. R. Okajima <hooanon05@yahoo.co.jp> Date: Fri Jan 7 10:44:44 2011 +0900 aufs: bugfix, O_CLOEXEC for the plink maintenance mode /sbin/mount.aufs (and others) puts aufs into the plink maintenance mode via /proc/fs/aufs/plink_maint which make many other operations to return error or block. During in this mode, /sbin/mount.aufs exec(2) the original mount(8). If mount(8) is not statically linked, it may mmap(2) ld.so (and others). And if ld.so is inside of the target aufs, then aufs mmap(2) blocks, ie. deadlock. To address this problem, specify O_CLOEXEC for /proc/fs/aufs/plink_maint which makes aufs to exit the plink maintenance mode, and ->release() doesn't care about pid. Reported-by: Marco Clocchiatti <ziapannocchia@gmail.com> Signed-off-by: J. R. Okajima <hooanon05@yahoo.co.jp> commit 24b389a51f85350d6fa465d22006cdd0a421ee30 Author: J. R. Okajima <hooanon05@yahoo.co.jp> Date: Mon Jan 3 10:16:17 2011 +0900 aufs: tiny, describe installing in aufs2-standalone.git Signed-off-by: J. R. Okajima <hooanon05@yahoo.co.jp> commit 58276fb0ea7dbfa57498fc96f87ecad91606fcd6 Author: J. R. Okajima <hooanon05@yahoo.co.jp> Date: Tue Dec 21 21:25:11 2010 +0900 aufs: new make target 'install' for stdalone Signed-off-by: J. R. Okajima <hooanon05@yahoo.co.jp> commit c1cf055abebe4e25d67aeb32208c60ae49da37ac Author: J. R. Okajima <hooanon05@yahoo.co.jp> Date: Mon Dec 20 16:00:01 2010 +0900 aufs: follow the changes in 2.6.37-rcN, aop->freepage Signed-off-by: J. R. Okajima <hooanon05@yahoo.co.jp> Signed-off-by: Andy Whitcroft <apw@canonical.com>
Diffstat (limited to 'ubuntu/aufs')
-rw-r--r--ubuntu/aufs/BOM2
-rw-r--r--ubuntu/aufs/aufs.h2
-rw-r--r--ubuntu/aufs/branch.c4
-rw-r--r--ubuntu/aufs/branch.h2
-rw-r--r--ubuntu/aufs/cpup.c2
-rw-r--r--ubuntu/aufs/cpup.h2
-rw-r--r--ubuntu/aufs/dbgaufs.c2
-rw-r--r--ubuntu/aufs/dbgaufs.h2
-rw-r--r--ubuntu/aufs/dcsub.c74
-rw-r--r--ubuntu/aufs/dcsub.h2
-rw-r--r--ubuntu/aufs/debug.c5
-rw-r--r--ubuntu/aufs/debug.h2
-rw-r--r--ubuntu/aufs/dentry.c15
-rw-r--r--ubuntu/aufs/dentry.h2
-rw-r--r--ubuntu/aufs/dinfo.c6
-rw-r--r--ubuntu/aufs/dir.c2
-rw-r--r--ubuntu/aufs/dir.h2
-rw-r--r--ubuntu/aufs/dynop.c3
-rw-r--r--ubuntu/aufs/dynop.h2
-rw-r--r--ubuntu/aufs/export.c15
-rw-r--r--ubuntu/aufs/f_op.c2
-rw-r--r--ubuntu/aufs/f_op_sp.c2
-rw-r--r--ubuntu/aufs/file.c2
-rw-r--r--ubuntu/aufs/file.h2
-rw-r--r--ubuntu/aufs/finfo.c2
-rw-r--r--ubuntu/aufs/fstype.h2
-rw-r--r--ubuntu/aufs/hfsnotify.c2
-rw-r--r--ubuntu/aufs/hfsplus.c2
-rw-r--r--ubuntu/aufs/hnotify.c39
-rw-r--r--ubuntu/aufs/i_op.c19
-rw-r--r--ubuntu/aufs/i_op_add.c2
-rw-r--r--ubuntu/aufs/i_op_del.c2
-rw-r--r--ubuntu/aufs/i_op_ren.c2
-rw-r--r--ubuntu/aufs/iinfo.c3
-rw-r--r--ubuntu/aufs/inode.c2
-rw-r--r--ubuntu/aufs/inode.h2
-rw-r--r--ubuntu/aufs/ioctl.c2
-rw-r--r--ubuntu/aufs/loop.c2
-rw-r--r--ubuntu/aufs/loop.h2
-rw-r--r--ubuntu/aufs/module.c2
-rw-r--r--ubuntu/aufs/module.h2
-rw-r--r--ubuntu/aufs/mtx.h2
-rw-r--r--ubuntu/aufs/opts.c2
-rw-r--r--ubuntu/aufs/opts.h2
-rw-r--r--ubuntu/aufs/plink.c11
-rw-r--r--ubuntu/aufs/poll.c2
-rw-r--r--ubuntu/aufs/procfs.c2
-rw-r--r--ubuntu/aufs/rdu.c2
-rw-r--r--ubuntu/aufs/rwsem.h2
-rw-r--r--ubuntu/aufs/sbinfo.c7
-rw-r--r--ubuntu/aufs/spl.h2
-rw-r--r--ubuntu/aufs/super.c14
-rw-r--r--ubuntu/aufs/super.h2
-rw-r--r--ubuntu/aufs/sysaufs.c2
-rw-r--r--ubuntu/aufs/sysaufs.h2
-rw-r--r--ubuntu/aufs/sysfs.c2
-rw-r--r--ubuntu/aufs/sysrq.c3
-rw-r--r--ubuntu/aufs/vdir.c2
-rw-r--r--ubuntu/aufs/vfsub.c5
-rw-r--r--ubuntu/aufs/vfsub.h2
-rw-r--r--ubuntu/aufs/wbr_policy.c2
-rw-r--r--ubuntu/aufs/whout.c8
-rw-r--r--ubuntu/aufs/whout.h2
-rw-r--r--ubuntu/aufs/wkq.c2
-rw-r--r--ubuntu/aufs/wkq.h2
-rw-r--r--ubuntu/aufs/xino.c2
66 files changed, 202 insertions, 129 deletions
diff --git a/ubuntu/aufs/BOM b/ubuntu/aufs/BOM
index bdad0cd19c5..288496226a1 100644
--- a/ubuntu/aufs/BOM
+++ b/ubuntu/aufs/BOM
@@ -1,2 +1,2 @@
URL: http://git.c3sl.ufpr.br/pub/scm/aufs/aufs2-standalone.git
-COMMIT: c5021514085a5d96364e096dbd34cadb2251abfd
+COMMIT: 806051bcbeec27748aae2b7957726a4e63ff308e
diff --git a/ubuntu/aufs/aufs.h b/ubuntu/aufs/aufs.h
index 1363f58ea4a..dd4d385fbb5 100644
--- a/ubuntu/aufs/aufs.h
+++ b/ubuntu/aufs/aufs.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/branch.c b/ubuntu/aufs/branch.c
index 25c523de95e..450ee7f3dba 100644
--- a/ubuntu/aufs/branch.c
+++ b/ubuntu/aufs/branch.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -555,7 +555,7 @@ static int test_dentry_busy(struct dentry *root, aufs_bindex_t bindex,
ndentry = dpage->ndentry;
for (j = 0; !err && j < ndentry; j++) {
d = dpage->dentries[j];
- AuDebugOn(!atomic_read(&d->d_count));
+ AuDebugOn(!d->d_count);
if (!au_digen_test(d, sigen)) {
di_read_lock_child(d, AuLock_IR);
if (unlikely(au_dbrange_test(d))) {
diff --git a/ubuntu/aufs/branch.h b/ubuntu/aufs/branch.h
index a273e60a597..fdcaca2cd9f 100644
--- a/ubuntu/aufs/branch.h
+++ b/ubuntu/aufs/branch.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/cpup.c b/ubuntu/aufs/cpup.c
index 3f667dd6acc..d12c6355393 100644
--- a/ubuntu/aufs/cpup.c
+++ b/ubuntu/aufs/cpup.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/cpup.h b/ubuntu/aufs/cpup.h
index cd77860c114..8e0aa591c62 100644
--- a/ubuntu/aufs/cpup.h
+++ b/ubuntu/aufs/cpup.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/dbgaufs.c b/ubuntu/aufs/dbgaufs.c
index 62058713e80..d372ca7dc17 100644
--- a/ubuntu/aufs/dbgaufs.c
+++ b/ubuntu/aufs/dbgaufs.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/dbgaufs.h b/ubuntu/aufs/dbgaufs.h
index ae41480d310..2eaa3f021bc 100644
--- a/ubuntu/aufs/dbgaufs.h
+++ b/ubuntu/aufs/dbgaufs.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/dcsub.c b/ubuntu/aufs/dcsub.c
index d9755f77859..0fde88b08c3 100644
--- a/ubuntu/aufs/dcsub.c
+++ b/ubuntu/aufs/dcsub.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -99,7 +99,7 @@ static int au_dpages_append(struct au_dcsub_pages *dpages,
}
/* d_count can be zero */
- dpage->dentries[dpage->ndentry++] = dget_locked(dentry);
+ dpage->dentries[dpage->ndentry++] = dget_dlock(dentry);
return 0; /* success */
out:
@@ -109,13 +109,17 @@ out:
int au_dcsub_pages(struct au_dcsub_pages *dpages, struct dentry *root,
au_dpages_test test, void *arg)
{
- int err;
- struct dentry *this_parent = root;
+ int err, locked = 0;
+ unsigned int seq;
+ struct dentry *this_parent;
struct list_head *next;
struct super_block *sb = root->d_sb;
err = 0;
- spin_lock(&dcache_lock);
+ seq = read_seqbegin(&rename_lock);
+again:
+ this_parent = root;
+ spin_lock(&this_parent->d_lock);
repeat:
next = this_parent->d_subdirs.next;
resume:
@@ -132,28 +136,62 @@ resume:
struct list_head *tmp = next;
struct dentry *dentry = list_entry(tmp, struct dentry,
d_u.d_child);
+
next = tmp->next;
+ spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
if (!list_empty(&dentry->d_subdirs)) {
+ spin_unlock(&this_parent->d_lock);
+ spin_release(&dentry->d_lock.dep_map, 1, _RET_IP_);
this_parent = dentry;
+ spin_acquire(&this_parent->d_lock.dep_map, 0, 1,
+ _RET_IP_);
goto repeat;
}
if (dentry->d_sb == sb
&& au_di(dentry)
- && (!test || test(dentry, arg))) {
+ && (!test || test(dentry, arg)))
err = au_dpages_append(dpages, dentry, GFP_ATOMIC);
- if (unlikely(err))
- goto out;
- }
+ spin_unlock(&dentry->d_lock);
+ if (unlikely(err))
+ goto out;
}
if (this_parent != root) {
- next = this_parent->d_u.d_child.next;
- this_parent = this_parent->d_parent; /* dcache_lock is locked */
+ struct dentry *tmp;
+ struct dentry *child;
+
+ tmp = this_parent->d_parent;
+ rcu_read_lock();
+ spin_unlock(&this_parent->d_lock);
+ 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;
}
+
out:
- spin_unlock(&dcache_lock);
+ spin_unlock(&this_parent->d_lock);
+ if (!locked) {
+ if (!err && read_seqretry(&rename_lock, seq))
+ goto rename_retry;
+ } else
+ 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,
@@ -162,14 +200,19 @@ int au_dcsub_pages_rev(struct au_dcsub_pages *dpages, struct dentry *dentry,
int err;
err = 0;
- spin_lock(&dcache_lock);
+ write_seqlock(&rename_lock);
if (do_include && (!test || test(dentry, arg))) {
err = au_dpages_append(dpages, dentry, GFP_ATOMIC);
if (unlikely(err))
goto out;
}
+
+ /*
+ * vfsmount_lock is unnecessary since this is a traverse in a single
+ * mount
+ */
while (!IS_ROOT(dentry)) {
- dentry = dentry->d_parent; /* dcache_lock is locked */
+ dentry = dentry->d_parent; /* rename_lock is locked */
if (!test || test(dentry, arg)) {
err = au_dpages_append(dpages, dentry, GFP_ATOMIC);
if (unlikely(err))
@@ -178,8 +221,7 @@ int au_dcsub_pages_rev(struct au_dcsub_pages *dpages, struct dentry *dentry,
}
out:
- spin_unlock(&dcache_lock);
-
+ write_sequnlock(&rename_lock);
return err;
}
diff --git a/ubuntu/aufs/dcsub.h b/ubuntu/aufs/dcsub.h
index 13b4fb2ca84..acab939b109 100644
--- a/ubuntu/aufs/dcsub.h
+++ b/ubuntu/aufs/dcsub.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/debug.c b/ubuntu/aufs/debug.c
index fd3ebd8481d..7fea72ae7f6 100644
--- a/ubuntu/aufs/debug.c
+++ b/ubuntu/aufs/debug.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -142,11 +142,12 @@ static int do_pri_dentry(aufs_bindex_t bindex, struct dentry *dentry)
return -1;
}
/* do not call dget_parent() here */
+ /* note: access d_xxx without d_lock */
dpri("d%d: %.*s?/%.*s, %s, cnt %d, flags 0x%x\n",
bindex,
AuDLNPair(dentry->d_parent), AuDLNPair(dentry),
dentry->d_sb ? au_sbtype(dentry->d_sb) : "??",
- atomic_read(&dentry->d_count), dentry->d_flags);
+ dentry->d_count, dentry->d_flags);
if (bindex >= 0 && dentry->d_inode && au_test_aufs(dentry->d_sb)) {
struct au_iinfo *iinfo = au_ii(dentry->d_inode);
if (iinfo)
diff --git a/ubuntu/aufs/debug.h b/ubuntu/aufs/debug.h
index cfe4413181b..1881844ec59 100644
--- a/ubuntu/aufs/debug.h
+++ b/ubuntu/aufs/debug.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/dentry.c b/ubuntu/aufs/dentry.c
index 8daf4a36aad..84d530ee362 100644
--- a/ubuntu/aufs/dentry.c
+++ b/ubuntu/aufs/dentry.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -827,11 +827,9 @@ int au_do_h_d_reval(struct dentry *h_dentry, struct nameidata *nd,
int (*reval)(struct dentry *, struct nameidata *);
err = 0;
- reval = NULL;
- if (h_dentry->d_op)
- reval = h_dentry->d_op->d_revalidate;
- if (!reval)
+ if (!(h_dentry->d_flags & DCACHE_OP_REVALIDATE))
goto out;
+ reval = h_dentry->d_op->d_revalidate;
AuDbg("b%d\n", bindex);
if (au_test_fs_null_nd(h_dentry->d_sb))
@@ -914,6 +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); */
h_name = &h_dentry->d_name;
if (unlikely(do_udba
&& !is_root
@@ -924,8 +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); */
goto err;
}
+ /* spin_unlock(&h_dentry->d_lock); */
err = au_do_h_d_reval(h_dentry, nd, dentry, bindex);
if (unlikely(err))
@@ -1044,6 +1045,10 @@ static int aufs_d_revalidate(struct dentry *dentry, struct nameidata *nd)
struct super_block *sb;
struct inode *inode;
+ /* todo: support rcu-walk? */
+ if (nd && (nd->flags & LOOKUP_RCU))
+ return -ECHILD;
+
valid = 0;
if (unlikely(!au_di(dentry)))
goto out;
diff --git a/ubuntu/aufs/dentry.h b/ubuntu/aufs/dentry.h
index 4865f5e0903..8fd0eba055f 100644
--- a/ubuntu/aufs/dentry.h
+++ b/ubuntu/aufs/dentry.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/dinfo.c b/ubuntu/aufs/dinfo.c
index fff8cdd2771..94545426007 100644
--- a/ubuntu/aufs/dinfo.c
+++ b/ubuntu/aufs/dinfo.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -128,7 +128,7 @@ int au_di_init(struct dentry *dentry)
if (dinfo) {
atomic_set(&dinfo->di_generation, au_sigen(sb));
/* smp_mb(); */ /* atomic_set */
- dentry->d_op = &aufs_dop;
+ d_set_d_op(dentry, &aufs_dop);
dentry->d_fsdata = dinfo;
} else
err = -ENOMEM;
@@ -319,7 +319,7 @@ struct dentry *au_h_dptr(struct dentry *dentry, aufs_bindex_t bindex)
return NULL;
AuDebugOn(bindex < 0);
d = au_di(dentry)->di_hdentry[0 + bindex].hd_dentry;
- AuDebugOn(d && (atomic_read(&d->d_count) <= 0));
+ AuDebugOn(d && d->d_count <= 0);
return d;
}
diff --git a/ubuntu/aufs/dir.c b/ubuntu/aufs/dir.c
index f2d9750c42f..e88d4f2613f 100644
--- a/ubuntu/aufs/dir.c
+++ b/ubuntu/aufs/dir.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/dir.h b/ubuntu/aufs/dir.h
index d07086827c1..2d0d8d2b151 100644
--- a/ubuntu/aufs/dir.h
+++ b/ubuntu/aufs/dir.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/dynop.c b/ubuntu/aufs/dynop.c
index 123262c1f91..23b2691af7a 100644
--- a/ubuntu/aufs/dynop.c
+++ b/ubuntu/aufs/dynop.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Junjiro R. Okajima
+ * Copyright (C) 2010-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -187,6 +187,7 @@ static void dy_aop(struct au_dykey *key, const void *h_op,
DySetAop(bmap);
DySetAop(invalidatepage);
DySetAop(releasepage);
+ DySetAop(freepage);
/* these two will be changed according to an aufs mount option */
DySetAop(direct_IO);
DySetAop(get_xip_mem);
diff --git a/ubuntu/aufs/dynop.h b/ubuntu/aufs/dynop.h
index 7d6d77727b9..d848aff0ff3 100644
--- a/ubuntu/aufs/dynop.h
+++ b/ubuntu/aufs/dynop.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Junjiro R. Okajima
+ * Copyright (C) 2010-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/export.c b/ubuntu/aufs/export.c
index b638ba60098..3a6ba18583e 100644
--- a/ubuntu/aufs/export.c
+++ b/ubuntu/aufs/export.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -85,6 +85,7 @@ enum {
static int au_test_anon(struct dentry *dentry)
{
+ /* note: read d_flags without d_lock */
return !!(dentry->d_flags & DCACHE_DISCONNECTED);
}
@@ -227,14 +228,18 @@ static struct dentry *decode_by_ino(struct super_block *sb, ino_t ino,
if (!dir_ino || S_ISDIR(inode->i_mode))
dentry = d_find_alias(inode);
else {
- spin_lock(&dcache_lock);
- list_for_each_entry(d, &inode->i_dentry, d_alias)
+ spin_lock(&inode->i_lock);
+ list_for_each_entry(d, &inode->i_dentry, d_alias) {
+ spin_lock(&d->d_lock);
if (!au_test_anon(d)
&& d->d_parent->d_inode->i_ino == dir_ino) {
- dentry = dget_locked(d);
+ dentry = dget_dlock(d);
+ spin_unlock(&d->d_lock);
break;
}
- spin_unlock(&dcache_lock);
+ spin_unlock(&d->d_lock);
+ }
+ spin_unlock(&inode->i_lock);
}
if (unlikely(dentry && au_digen_test(dentry, sigen))) {
dput(dentry);
diff --git a/ubuntu/aufs/f_op.c b/ubuntu/aufs/f_op.c
index ff0f44bd201..aa8e3a88eb7 100644
--- a/ubuntu/aufs/f_op.c
+++ b/ubuntu/aufs/f_op.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/f_op_sp.c b/ubuntu/aufs/f_op_sp.c
index b9c3679f6c2..4f5cde800d4 100644
--- a/ubuntu/aufs/f_op_sp.c
+++ b/ubuntu/aufs/f_op_sp.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/file.c b/ubuntu/aufs/file.c
index 2ba0c000f16..4b6c4b22729 100644
--- a/ubuntu/aufs/file.c
+++ b/ubuntu/aufs/file.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/file.h b/ubuntu/aufs/file.h
index e0d52ef9e53..5ee45a10abd 100644
--- a/ubuntu/aufs/file.h
+++ b/ubuntu/aufs/file.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/finfo.c b/ubuntu/aufs/finfo.c
index 0ffb5538fd1..b8fa4d853a4 100644
--- a/ubuntu/aufs/finfo.c
+++ b/ubuntu/aufs/finfo.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/fstype.h b/ubuntu/aufs/fstype.h
index 270f2a4d4dd..3bdbd143a82 100644
--- a/ubuntu/aufs/fstype.h
+++ b/ubuntu/aufs/fstype.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/hfsnotify.c b/ubuntu/aufs/hfsnotify.c
index eaed1f12395..deb0ab4a0ae 100644
--- a/ubuntu/aufs/hfsnotify.c
+++ b/ubuntu/aufs/hfsnotify.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/hfsplus.c b/ubuntu/aufs/hfsplus.c
index 3bb997c780c..678b69c6968 100644
--- a/ubuntu/aufs/hfsplus.c
+++ b/ubuntu/aufs/hfsplus.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Junjiro R. Okajima
+ * Copyright (C) 2010-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/hnotify.c b/ubuntu/aufs/hnotify.c
index 68279f9fa04..5eb51fa9629 100644
--- a/ubuntu/aufs/hnotify.c
+++ b/ubuntu/aufs/hnotify.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -209,17 +209,21 @@ static int hn_gen_by_inode(char *name, unsigned int nlen, struct inode *inode,
if (!isdir) {
AuDebugOn(!name);
au_iigen_dec(inode);
- spin_lock(&dcache_lock);
+ spin_lock(&inode->i_lock);
list_for_each_entry(d, &inode->i_dentry, d_alias) {
+ spin_lock(&d->d_lock);
dname = &d->d_name;
if (dname->len != nlen
- && memcmp(dname->name, name, nlen))
+ && memcmp(dname->name, name, nlen)) {
+ spin_unlock(&d->d_lock);
continue;
+ }
err = 0;
au_digen_dec(d);
+ spin_unlock(&d->d_lock);
break;
}
- spin_unlock(&dcache_lock);
+ spin_unlock(&inode->i_lock);
} else {
au_fset_si(au_sbi(inode->i_sb), FAILED_REFRESH_DIR);
d = d_find_alias(inode);
@@ -228,9 +232,14 @@ static int hn_gen_by_inode(char *name, unsigned int nlen, struct inode *inode,
goto out;
}
+ spin_lock(&d->d_lock);
dname = &d->d_name;
- if (dname->len == nlen && !memcmp(dname->name, name, nlen))
+ if (dname->len == nlen && !memcmp(dname->name, name, nlen)) {
+ spin_unlock(&d->d_lock);
err = hn_gen_tree(d);
+ spin_lock(&d->d_lock);
+ }
+ spin_unlock(&d->d_lock);
dput(d);
}
@@ -366,23 +375,27 @@ static struct dentry *lookup_wlock_by_name(char *name, unsigned int nlen,
return NULL;
dentry = NULL;
- spin_lock(&dcache_lock);
+ spin_lock(&parent->d_lock);
list_for_each_entry(d, &parent->d_subdirs, d_u.d_child) {
/* AuDbg("%.*s\n", AuDLNPair(d)); */
+ spin_lock_nested(&d->d_lock, DENTRY_D_LOCK_NESTED);
dname = &d->d_name;
if (dname->len != nlen || memcmp(dname->name, name, nlen))
- continue;
+ goto cont_unlock;
if (au_di(d))
au_digen_dec(d);
else
- continue;
- if (!atomic_read(&d->d_count))
- continue;
+ goto cont_unlock;
+ if (d->d_count) {
+ dentry = dget_dlock(d);
+ spin_unlock(&d->d_lock);
+ break;
+ }
- dentry = dget(d);
- break;
+ cont_unlock:
+ spin_unlock(&d->d_lock);
}
- spin_unlock(&dcache_lock);
+ spin_unlock(&parent->d_lock);
dput(parent);
if (dentry)
diff --git a/ubuntu/aufs/i_op.c b/ubuntu/aufs/i_op.c
index dddcaca16a9..aba296e7dbd 100644
--- a/ubuntu/aufs/i_op.c
+++ b/ubuntu/aufs/i_op.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -28,7 +28,7 @@
#include <linux/uaccess.h>
#include "aufs.h"
-static int h_permission(struct inode *h_inode, int mask,
+static int h_permission(struct inode *h_inode, int mask, unsigned int flags,
struct vfsmount *h_mnt, int brperm)
{
int err;
@@ -52,11 +52,11 @@ static int h_permission(struct inode *h_inode, int mask,
&& write_mask && !(mask & MAY_READ))
|| !h_inode->i_op->permission) {
/* AuLabel(generic_permission); */
- err = generic_permission(h_inode, mask,
+ err = generic_permission(h_inode, mask, flags,
h_inode->i_op->check_acl);
} else {
/* AuLabel(h_inode->permission); */
- err = h_inode->i_op->permission(h_inode, mask);
+ err = h_inode->i_op->permission(h_inode, mask, flags);
AuTraceErr(err);
}
@@ -82,7 +82,7 @@ out:
return err;
}
-static int aufs_permission(struct inode *inode, int mask)
+static int aufs_permission(struct inode *inode, int mask, unsigned int flags)
{
int err;
aufs_bindex_t bindex, bend;
@@ -92,6 +92,10 @@ static int aufs_permission(struct inode *inode, int mask)
struct super_block *sb;
struct au_branch *br;
+ /* todo: support rcu-walk? */
+ if (flags & IPERM_FLAG_RCU)
+ return -ECHILD;
+
sb = inode->i_sb;
si_read_lock(sb, AuLock_FLUSH);
ii_read_lock_child(inode);
@@ -112,7 +116,8 @@ static int aufs_permission(struct inode *inode, int mask)
err = 0;
bindex = au_ibstart(inode);
br = au_sbr(sb, bindex);
- err = h_permission(h_inode, mask, br->br_mnt, br->br_perm);
+ err = h_permission(h_inode, mask, flags, br->br_mnt,
+ br->br_perm);
if (write_mask
&& !err
&& !special_file(h_inode->i_mode)) {
@@ -138,7 +143,7 @@ static int aufs_permission(struct inode *inode, int mask)
break;
br = au_sbr(sb, bindex);
- err = h_permission(h_inode, mask, br->br_mnt,
+ err = h_permission(h_inode, mask, flags, br->br_mnt,
br->br_perm);
}
}
diff --git a/ubuntu/aufs/i_op_add.c b/ubuntu/aufs/i_op_add.c
index cd11360361d..070f6314ece 100644
--- a/ubuntu/aufs/i_op_add.c
+++ b/ubuntu/aufs/i_op_add.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/i_op_del.c b/ubuntu/aufs/i_op_del.c
index 1019bf91aea..a46720b8d26 100644
--- a/ubuntu/aufs/i_op_del.c
+++ b/ubuntu/aufs/i_op_del.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/i_op_ren.c b/ubuntu/aufs/i_op_ren.c
index e1d23928cf7..f7dd41986f6 100644
--- a/ubuntu/aufs/i_op_ren.c
+++ b/ubuntu/aufs/i_op_ren.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/iinfo.c b/ubuntu/aufs/iinfo.c
index 571b21d25fc..cd1086eb459 100644
--- a/ubuntu/aufs/iinfo.c
+++ b/ubuntu/aufs/iinfo.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -259,5 +259,6 @@ void au_iinfo_fin(struct inode *inode)
}
}
kfree(iinfo->ii_hinode);
+ iinfo->ii_hinode = NULL;
AuRwDestroy(&iinfo->ii_rwsem);
}
diff --git a/ubuntu/aufs/inode.c b/ubuntu/aufs/inode.c
index 9fe4d50e20f..00ae8877b7d 100644
--- a/ubuntu/aufs/inode.c
+++ b/ubuntu/aufs/inode.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/inode.h b/ubuntu/aufs/inode.h
index 9f004a03d93..58144e42905 100644
--- a/ubuntu/aufs/inode.h
+++ b/ubuntu/aufs/inode.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/ioctl.c b/ubuntu/aufs/ioctl.c
index 8e1fc799cc7..bb87a2229a8 100644
--- a/ubuntu/aufs/ioctl.c
+++ b/ubuntu/aufs/ioctl.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/loop.c b/ubuntu/aufs/loop.c
index 96d50e30e48..1fbe0c44b16 100644
--- a/ubuntu/aufs/loop.c
+++ b/ubuntu/aufs/loop.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/loop.h b/ubuntu/aufs/loop.h
index c7ebb79766a..3b6fc6f461e 100644
--- a/ubuntu/aufs/loop.h
+++ b/ubuntu/aufs/loop.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/module.c b/ubuntu/aufs/module.c
index 4f6967ea615..1d81c6421ed 100644
--- a/ubuntu/aufs/module.c
+++ b/ubuntu/aufs/module.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/module.h b/ubuntu/aufs/module.h
index 5acab850385..3e1655ffdf2 100644
--- a/ubuntu/aufs/module.h
+++ b/ubuntu/aufs/module.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/mtx.h b/ubuntu/aufs/mtx.h
index 1b7e6f0a345..31f1abc736a 100644
--- a/ubuntu/aufs/mtx.h
+++ b/ubuntu/aufs/mtx.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Junjiro R. Okajima
+ * Copyright (C) 2010-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/opts.c b/ubuntu/aufs/opts.c
index b41f5a1944c..7f4ba0ccaf5 100644
--- a/ubuntu/aufs/opts.c
+++ b/ubuntu/aufs/opts.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/opts.h b/ubuntu/aufs/opts.h
index e788621447d..a351be51daa 100644
--- a/ubuntu/aufs/opts.h
+++ b/ubuntu/aufs/opts.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/plink.c b/ubuntu/aufs/plink.c
index d3995bcf5a5..b1888f30c71 100644
--- a/ubuntu/aufs/plink.c
+++ b/ubuntu/aufs/plink.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -89,15 +89,10 @@ out:
void au_plink_maint_leave(struct au_sbinfo *sbinfo)
{
- int iam;
-
spin_lock(&sbinfo->si_plink_maint_lock);
- iam = (sbinfo->si_plink_maint_pid == current->pid);
- if (iam)
- sbinfo->si_plink_maint_pid = 0;
+ sbinfo->si_plink_maint_pid = 0;
spin_unlock(&sbinfo->si_plink_maint_lock);
- if (iam)
- wake_up_all(&sbinfo->si_plink_wq);
+ wake_up_all(&sbinfo->si_plink_wq);
}
int au_plink_maint_enter(struct super_block *sb)
diff --git a/ubuntu/aufs/poll.c b/ubuntu/aufs/poll.c
index cc19e611eb4..873f3bb5e6b 100644
--- a/ubuntu/aufs/poll.c
+++ b/ubuntu/aufs/poll.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/procfs.c b/ubuntu/aufs/procfs.c
index 7810a6ec2d1..65d253863c0 100644
--- a/ubuntu/aufs/procfs.c
+++ b/ubuntu/aufs/procfs.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 Junjiro R. Okajima
+ * Copyright (C) 2010-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/rdu.c b/ubuntu/aufs/rdu.c
index 627232894e0..4a5182f2596 100644
--- a/ubuntu/aufs/rdu.c
+++ b/ubuntu/aufs/rdu.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/rwsem.h b/ubuntu/aufs/rwsem.h
index c3575eed291..dcd1def9eed 100644
--- a/ubuntu/aufs/rwsem.h
+++ b/ubuntu/aufs/rwsem.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/sbinfo.c b/ubuntu/aufs/sbinfo.c
index 42783dcd873..d9141f8cc48 100644
--- a/ubuntu/aufs/sbinfo.c
+++ b/ubuntu/aufs/sbinfo.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -309,7 +309,7 @@ int si_pid_test_slow(struct super_block *sb)
p = radix_tree_lookup(&au_sbi(sb)->au_si_pid.tree, current->pid);
rcu_read_unlock();
- return (long)p;
+ return (long)!!p;
}
void si_pid_set_slow(struct super_block *sb)
@@ -324,7 +324,7 @@ void si_pid_set_slow(struct super_block *sb)
AuDebugOn(err);
spin_lock(&sbinfo->au_si_pid.tree_lock);
err = radix_tree_insert(&sbinfo->au_si_pid.tree, current->pid,
- (void *)1);
+ /*any valid ptr*/sb);
spin_unlock(&sbinfo->au_si_pid.tree_lock);
AuDebugOn(err);
radix_tree_preload_end();
@@ -341,5 +341,4 @@ void si_pid_clr_slow(struct super_block *sb)
spin_lock(&sbinfo->au_si_pid.tree_lock);
p = radix_tree_delete(&sbinfo->au_si_pid.tree, current->pid);
spin_unlock(&sbinfo->au_si_pid.tree_lock);
- AuDebugOn(1 != (long)p);
}
diff --git a/ubuntu/aufs/spl.h b/ubuntu/aufs/spl.h
index f3340340fe9..37a032907a3 100644
--- a/ubuntu/aufs/spl.h
+++ b/ubuntu/aufs/spl.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/super.c b/ubuntu/aufs/super.c
index 008702ddecb..3776125793b 100644
--- a/ubuntu/aufs/super.c
+++ b/ubuntu/aufs/super.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -46,10 +46,18 @@ static struct inode *aufs_alloc_inode(struct super_block *sb __maybe_unused)
return NULL;
}
+static void aufs_destroy_inode_cb(struct rcu_head *head)
+{
+ struct inode *inode = container_of(head, struct inode, i_rcu);
+
+ INIT_LIST_HEAD(&inode->i_dentry);
+ au_cache_free_icntnr(container_of(inode, struct au_icntnr, vfs_inode));
+}
+
static void aufs_destroy_inode(struct inode *inode)
{
au_iinfo_fin(inode);
- au_cache_free_icntnr(container_of(inode, struct au_icntnr, vfs_inode));
+ call_rcu(&inode->i_rcu, aufs_destroy_inode_cb);
}
struct inode *au_iget_locked(struct super_block *sb, ino_t ino)
@@ -899,8 +907,6 @@ static void aufs_kill_sb(struct super_block *sb)
au_plink_put(sb, /*verbose*/1);
au_xino_clr(sb);
aufs_write_unlock(sb->s_root);
-
- au_plink_maint_leave(sbinfo);
au_nwt_flush(&sbinfo->si_nowait);
}
generic_shutdown_super(sb);
diff --git a/ubuntu/aufs/super.h b/ubuntu/aufs/super.h
index 1930ce71a66..33dd69cc608 100644
--- a/ubuntu/aufs/super.h
+++ b/ubuntu/aufs/super.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/sysaufs.c b/ubuntu/aufs/sysaufs.c
index 529b59bdcdd..ab4036e18a6 100644
--- a/ubuntu/aufs/sysaufs.c
+++ b/ubuntu/aufs/sysaufs.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/sysaufs.h b/ubuntu/aufs/sysaufs.h
index 36eb291c374..5b6b8d0c5a8 100644
--- a/ubuntu/aufs/sysaufs.h
+++ b/ubuntu/aufs/sysaufs.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/sysfs.c b/ubuntu/aufs/sysfs.c
index cb0310db40c..f675fb39179 100644
--- a/ubuntu/aufs/sysfs.c
+++ b/ubuntu/aufs/sysfs.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/sysrq.c b/ubuntu/aufs/sysrq.c
index 452fe3a25fc..12f6b23221b 100644
--- a/ubuntu/aufs/sysrq.c
+++ b/ubuntu/aufs/sysrq.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -60,6 +60,7 @@ 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++) {
diff --git a/ubuntu/aufs/vdir.c b/ubuntu/aufs/vdir.c
index 5777ca463e3..5e423768665 100644
--- a/ubuntu/aufs/vdir.c
+++ b/ubuntu/aufs/vdir.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/vfsub.c b/ubuntu/aufs/vfsub.c
index 846a124a2e1..76a6c79b62b 100644
--- a/ubuntu/aufs/vfsub.c
+++ b/ubuntu/aufs/vfsub.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -729,8 +729,7 @@ 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)
- && atomic_read(&d->d_count) == 1);
+ const int stop_sillyrename = au_test_nfs(d->d_sb);
IMustLock(a->dir);
diff --git a/ubuntu/aufs/vfsub.h b/ubuntu/aufs/vfsub.h
index 9a9f2669b34..7615bf02546 100644
--- a/ubuntu/aufs/vfsub.h
+++ b/ubuntu/aufs/vfsub.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/wbr_policy.c b/ubuntu/aufs/wbr_policy.c
index 9e4f1e48b4e..dec340a4ef0 100644
--- a/ubuntu/aufs/wbr_policy.c
+++ b/ubuntu/aufs/wbr_policy.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/whout.c b/ubuntu/aufs/whout.c
index bdc989bb9d2..7ccf17de9f8 100644
--- a/ubuntu/aufs/whout.c
+++ b/ubuntu/aufs/whout.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -121,7 +121,7 @@ struct dentry *au_whtmp_lkup(struct dentry *h_parent, struct au_branch *br,
{
struct dentry *dentry;
int i;
- char defname[NAME_MAX - AUFS_MAX_NAMELEN + DNAME_INLINE_LEN_MIN + 1],
+ char defname[NAME_MAX - AUFS_MAX_NAMELEN + DNAME_INLINE_LEN + 1],
*name, *p;
/* strict atomic_t is unnecessary here */
static unsigned short cnt;
@@ -130,8 +130,8 @@ struct dentry *au_whtmp_lkup(struct dentry *h_parent, struct au_branch *br,
BUILD_BUG_ON(sizeof(cnt) * 2 > AUFS_WH_TMP_LEN);
name = defname;
- qs.len = sizeof(defname) - DNAME_INLINE_LEN_MIN + prefix->len - 1;
- if (unlikely(prefix->len > DNAME_INLINE_LEN_MIN)) {
+ qs.len = sizeof(defname) - DNAME_INLINE_LEN + prefix->len - 1;
+ if (unlikely(prefix->len > DNAME_INLINE_LEN)) {
dentry = ERR_PTR(-ENAMETOOLONG);
if (unlikely(qs.len > NAME_MAX))
goto out;
diff --git a/ubuntu/aufs/whout.h b/ubuntu/aufs/whout.h
index b262ffd6e0c..11137f40049 100644
--- a/ubuntu/aufs/whout.h
+++ b/ubuntu/aufs/whout.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/wkq.c b/ubuntu/aufs/wkq.c
index c2a31f99211..2ee408abf2a 100644
--- a/ubuntu/aufs/wkq.c
+++ b/ubuntu/aufs/wkq.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/wkq.h b/ubuntu/aufs/wkq.h
index b216f03d6e3..804f5a069dd 100644
--- a/ubuntu/aufs/wkq.h
+++ b/ubuntu/aufs/wkq.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
diff --git a/ubuntu/aufs/xino.c b/ubuntu/aufs/xino.c
index 7c21a4aa00c..7c8bb43631a 100644
--- a/ubuntu/aufs/xino.c
+++ b/ubuntu/aufs/xino.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2005-2010 Junjiro R. Okajima
+ * Copyright (C) 2005-2011 Junjiro R. Okajima
*
* This program, aufs is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by