From 07053da62e4692bc8c83c8b13e22e69857cb1fb8 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Wed, 10 Oct 2012 01:36:42 +0000 Subject: [PATCH] aufs: Update to aufs3.x-rcN-20120827 svn path=/dists/trunk/linux/; revision=19427 --- debian/changelog | 3 + .../features/all/aufs3/aufs3-add.patch | 476 +++++++----------- .../features/all/aufs3/aufs3-base.patch | 39 +- .../features/all/aufs3/aufs3-kbuild.patch | 4 +- .../features/all/aufs3/aufs3-standalone.patch | 34 +- debian/patches/series | 10 +- 6 files changed, 211 insertions(+), 355 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8a7ce94e5..a7bef4593 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,9 @@ linux (3.6.1-1~experimental.1) UNRELEASED; urgency=low * New upstream stable update: http://www.kernel.org/pub/linux/kernel/v3.x/ChangeLog-3.6.1 + [ Ben Hutchings ] + * aufs: Update to aufs3.x-rcN-20120827 + -- Bastian Blank Thu, 04 Oct 2012 17:50:39 +0200 linux (3.5.5-1~experimental.1) experimental; urgency=low diff --git a/debian/patches/features/all/aufs3/aufs3-add.patch b/debian/patches/features/all/aufs3/aufs3-add.patch index 64e253973..fd529d26d 100644 --- a/debian/patches/features/all/aufs3/aufs3-add.patch +++ b/debian/patches/features/all/aufs3/aufs3-add.patch @@ -313,7 +313,7 @@ +#endif /* __KERNEL__ */ +#endif /* __AUFS_H__ */ --- a/fs/aufs/branch.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/branch.c 2012-07-22 01:31:00.134115312 +0100 ++++ b/fs/aufs/branch.c 2012-10-10 02:27:30.002284137 +0100 @@ -0,0 +1,1169 @@ +/* + * Copyright (C) 2005-2012 Junjiro R. Okajima @@ -1389,7 +1389,7 @@ + spin_unlock(&hf->f_lock); + if (!file_check_writeable(hf)) { + file_release_write(hf); -+ mnt_drop_write(hf->f_vfsmnt); ++ vfsub_mnt_drop_write(hf->f_vfsmnt); + } + } + @@ -1759,8 +1759,8 @@ + +-include ${srctree}/${src}/conf_priv.mk --- a/fs/aufs/cpup.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/cpup.c 2012-07-22 01:31:00.162115458 +0100 -@@ -0,0 +1,1084 @@ ++++ b/fs/aufs/cpup.c 2012-10-10 02:27:30.002284137 +0100 +@@ -0,0 +1,1085 @@ +/* + * Copyright (C) 2005-2012 Junjiro R. Okajima + * @@ -2249,7 +2249,8 @@ + case S_IFREG: + /* try stopping to update while we are referencing */ + IMustLock(h_inode); -+ err = vfsub_create(h_dir, &h_path, mode | S_IWUSR); ++ err = vfsub_create(h_dir, &h_path, mode | S_IWUSR, ++ /*want_excl*/true); + if (!err) + err = au_do_cpup_regular + (dentry, bdst, bsrc, len, @@ -3662,8 +3663,8 @@ +#endif /* __KERNEL__ */ +#endif /* __AUFS_DCSUB_H__ */ --- a/fs/aufs/debug.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/debug.c 2012-07-22 01:31:00.162115458 +0100 -@@ -0,0 +1,489 @@ ++++ b/fs/aufs/debug.c 2012-10-10 02:27:30.002284137 +0100 +@@ -0,0 +1,490 @@ +/* + * Copyright (C) 2005-2012 Junjiro R. Okajima + * @@ -3804,9 +3805,10 @@ +void au_dpri_dalias(struct inode *inode) +{ + struct dentry *d; ++ struct hlist_node *p; + + spin_lock(&inode->i_lock); -+ list_for_each_entry(d, &inode->i_dentry, d_alias) ++ hlist_for_each_entry(d, p, &inode->i_dentry, d_alias) + au_dpri_dentry(d); + spin_unlock(&inode->i_lock); +} @@ -4399,8 +4401,8 @@ +#endif /* __KERNEL__ */ +#endif /* __AUFS_DEBUG_H__ */ --- a/fs/aufs/dentry.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/dentry.c 2012-07-22 01:31:00.162115458 +0100 -@@ -0,0 +1,1140 @@ ++++ b/fs/aufs/dentry.c 2012-10-10 02:27:30.002284137 +0100 +@@ -0,0 +1,1063 @@ +/* + * Copyright (C) 2005-2012 Junjiro R. Okajima + * @@ -4426,63 +4428,6 @@ +#include +#include "aufs.h" + -+static void au_h_nd(struct nameidata *h_nd, struct nameidata *nd) -+{ -+ if (nd) { -+ *h_nd = *nd; -+ -+ /* -+ * gave up supporting LOOKUP_CREATE/OPEN for lower fs, -+ * due to whiteout and branch permission. -+ */ -+ h_nd->flags &= ~(/*LOOKUP_PARENT |*/ LOOKUP_OPEN | LOOKUP_CREATE -+ | LOOKUP_FOLLOW | LOOKUP_EXCL); -+ /* unnecessary? */ -+ h_nd->intent.open.file = NULL; -+ } else -+ memset(h_nd, 0, sizeof(*h_nd)); -+} -+ -+struct au_lkup_one_args { -+ struct dentry **errp; -+ struct qstr *name; -+ struct dentry *h_parent; -+ struct au_branch *br; -+ struct nameidata *nd; -+}; -+ -+struct dentry *au_lkup_one(struct qstr *name, struct dentry *h_parent, -+ struct au_branch *br, struct nameidata *nd) -+{ -+ struct dentry *h_dentry; -+ int err; -+ struct nameidata h_nd; -+ -+ if (au_test_fs_null_nd(h_parent->d_sb)) -+ return vfsub_lookup_one_len(name->name, h_parent, name->len); -+ -+ au_h_nd(&h_nd, nd); -+ h_nd.path.dentry = h_parent; -+ h_nd.path.mnt = br->br_mnt; -+ -+ err = vfsub_name_hash(name->name, &h_nd.last, name->len); -+ h_dentry = ERR_PTR(err); -+ if (!err) { -+ path_get(&h_nd.path); -+ h_dentry = vfsub_lookup_hash(&h_nd); -+ path_put(&h_nd.path); -+ } -+ -+ AuTraceErrPtr(h_dentry); -+ return h_dentry; -+} -+ -+static void au_call_lkup_one(void *args) -+{ -+ struct au_lkup_one_args *a = args; -+ *a->errp = au_lkup_one(a->name, a->h_parent, a->br, a->nd); -+} -+ +#define AuLkup_ALLOW_NEG 1 +#define au_ftest_lkup(flags, name) ((flags) & AuLkup_##name) +#define au_fset_lkup(flags, name) \ @@ -4493,7 +4438,7 @@ +struct au_do_lookup_args { + unsigned int flags; + mode_t type; -+ struct nameidata *nd; ++ unsigned int nd_flags; +}; + +/* @@ -4530,7 +4475,7 @@ + return NULL; /* success */ + +real_lookup: -+ h_dentry = au_lkup_one(&dentry->d_name, h_parent, br, args->nd); ++ h_dentry = vfsub_lkup_one(&dentry->d_name, h_parent); + if (IS_ERR(h_dentry)) + goto out; + @@ -4585,16 +4530,16 @@ + * can be called at unlinking with @type is zero. + */ +int au_lkup_dentry(struct dentry *dentry, aufs_bindex_t bstart, mode_t type, -+ struct nameidata *nd) ++ unsigned int flags) +{ + int npositive, err; + aufs_bindex_t bindex, btail, bdiropq; + unsigned char isdir; + struct qstr whname; + struct au_do_lookup_args args = { -+ .flags = 0, -+ .type = type, -+ .nd = nd ++ .flags = 0, ++ .type = type, ++ .nd_flags = flags + }; + const struct qstr *name = &dentry->d_name; + struct dentry *parent; @@ -4690,17 +4635,15 @@ + int wkq_err; + + if (!au_test_h_perm_sio(parent->d_inode, MAY_EXEC)) -+ dentry = au_lkup_one(name, parent, br, /*nd*/NULL); ++ dentry = vfsub_lkup_one(name, parent); + else { -+ struct au_lkup_one_args args = { -+ .errp = &dentry, -+ .name = name, -+ .h_parent = parent, -+ .br = br, -+ .nd = NULL ++ struct vfsub_lkup_one_args args = { ++ .errp = &dentry, ++ .name = name, ++ .parent = parent + }; + -+ wkq_err = au_wkq_wait(au_call_lkup_one, &args); ++ wkq_err = au_wkq_wait(vfsub_call_lkup_one, &args); + if (unlikely(wkq_err)) + dentry = ERR_PTR(wkq_err); + } @@ -4778,7 +4721,7 @@ + return ia->i_ino != h_inode->i_ino + /* || ia->i_nlink != h_inode->i_nlink */ + || !uid_eq(ia->i_uid, h_inode->i_uid) -+ || !uid_eq(ia->i_gid, h_inode->i_gid) ++ || !gid_eq(ia->i_gid, h_inode->i_gid) + || ia->i_version != h_inode->i_version +/* + || ia->i_size != h_inode->i_size @@ -4808,7 +4751,7 @@ + goto out; + + /* main purpose is namei.c:cached_lookup() and d_revalidate */ -+ h_d = au_lkup_one(&h_dentry->d_name, h_parent, br, /*nd*/NULL); ++ h_d = vfsub_lkup_one(&h_dentry->d_name, h_parent); + err = PTR_ERR(h_d); + if (IS_ERR(h_d)) + goto out; @@ -5194,7 +5137,7 @@ + * if current working dir is removed, it returns an error. + * but the dentry is legal. + */ -+ err = au_lkup_dentry(dentry, /*bstart*/0, /*type*/0, /*nd*/NULL); ++ err = au_lkup_dentry(dentry, /*bstart*/0, /*type*/0, /*flags*/0); + AuDbgDentry(dentry); + au_di_swap(tmp, dinfo); + if (err == -ENOENT) @@ -5223,42 +5166,24 @@ + return err; +} + -+static noinline_for_stack -+int au_do_h_d_reval(struct dentry *h_dentry, struct nameidata *nd, -+ struct dentry *dentry, aufs_bindex_t bindex) ++static int au_do_h_d_reval(struct dentry *h_dentry, unsigned int flags, ++ struct dentry *dentry, aufs_bindex_t bindex) +{ + int err, valid; -+ int (*reval)(struct dentry *, struct nameidata *); + + err = 0; + 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)) -+ /* it may return tri-state */ -+ valid = reval(h_dentry, NULL); -+ else { -+ struct nameidata h_nd; -+ int locked; -+ struct dentry *parent; -+ -+ au_h_nd(&h_nd, nd); -+ parent = nd->path.dentry; -+ locked = (nd && nd->path.dentry != dentry); -+ if (locked) -+ di_read_lock_parent(parent, AuLock_IR); -+ BUG_ON(bindex > au_dbend(parent)); -+ h_nd.path.dentry = au_h_dptr(parent, bindex); -+ BUG_ON(!h_nd.path.dentry); -+ h_nd.path.mnt = au_sbr(parent->d_sb, bindex)->br_mnt; -+ path_get(&h_nd.path); -+ valid = reval(h_dentry, &h_nd); -+ path_put(&h_nd.path); -+ if (locked) -+ di_read_unlock(parent, AuLock_IR); -+ } ++ /* ++ * gave up supporting LOOKUP_CREATE/OPEN for lower fs, ++ * due to whiteout and branch permission. ++ */ ++ flags &= ~(/*LOOKUP_PARENT |*/ LOOKUP_OPEN | LOOKUP_CREATE ++ | LOOKUP_FOLLOW | LOOKUP_EXCL); ++ /* it may return tri-state */ ++ valid = h_dentry->d_op->d_revalidate(h_dentry, flags); + + if (unlikely(valid < 0)) + err = valid; @@ -5272,7 +5197,7 @@ + +/* todo: remove this */ +static int h_d_revalidate(struct dentry *dentry, struct inode *inode, -+ struct nameidata *nd, int do_udba) ++ unsigned int flags, int do_udba) +{ + int err; + umode_t mode, h_mode; @@ -5332,7 +5257,7 @@ + } + spin_unlock(&h_dentry->d_lock); + -+ err = au_do_h_d_reval(h_dentry, nd, dentry, bindex); ++ err = au_do_h_d_reval(h_dentry, flags, dentry, bindex); + if (unlikely(err)) + /* do not goto err, to keep the errno */ + break; @@ -5441,7 +5366,7 @@ +/* + * if valid returns 1, otherwise 0. + */ -+static int aufs_d_revalidate(struct dentry *dentry, struct nameidata *nd) ++static int aufs_d_revalidate(struct dentry *dentry, unsigned int flags) +{ + int valid, err; + unsigned int sigen; @@ -5450,7 +5375,7 @@ + struct inode *inode; + + /* todo: support rcu-walk? */ -+ if (nd && (nd->flags & LOOKUP_RCU)) ++ if (flags & LOOKUP_RCU) + return -ECHILD; + + valid = 0; @@ -5507,7 +5432,7 @@ + } + } + -+ err = h_d_revalidate(dentry, inode, nd, do_udba); ++ err = h_d_revalidate(dentry, inode, flags, do_udba); + if (unlikely(!err && do_udba && au_dbstart(dentry) < 0)) { + err = -EIO; + AuDbg("both of real entry and whiteout found, %.*s, err %d\n", @@ -5542,8 +5467,8 @@ + .d_release = aufs_d_release +}; --- a/fs/aufs/dentry.h 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/dentry.h 2012-01-10 02:15:56.549455982 +0000 -@@ -0,0 +1,237 @@ ++++ b/fs/aufs/dentry.h 2012-10-10 02:27:30.002284137 +0100 +@@ -0,0 +1,235 @@ +/* + * Copyright (C) 2005-2012 Junjiro R. Okajima + * @@ -5592,15 +5517,13 @@ +/* dentry.c */ +extern const struct dentry_operations aufs_dop; +struct au_branch; -+struct dentry *au_lkup_one(struct qstr *name, struct dentry *h_parent, -+ struct au_branch *br, struct nameidata *nd); +struct dentry *au_sio_lkup_one(struct qstr *name, struct dentry *parent, + struct au_branch *br); +int au_h_verify(struct dentry *h_dentry, unsigned int udba, struct inode *h_dir, + struct dentry *h_parent, struct au_branch *br); + +int au_lkup_dentry(struct dentry *dentry, aufs_bindex_t bstart, mode_t type, -+ struct nameidata *nd); ++ unsigned int flags); +int au_lkup_neg(struct dentry *dentry, aufs_bindex_t bindex); +int au_refresh_dentry(struct dentry *dentry, struct dentry *parent); +int au_reval_dpath(struct dentry *dentry, unsigned int sigen); @@ -6328,8 +6251,8 @@ + return -1; +} --- a/fs/aufs/dir.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/dir.c 2012-06-04 21:49:59.814840078 +0100 -@@ -0,0 +1,636 @@ ++++ b/fs/aufs/dir.c 2012-10-10 02:27:30.006284153 +0100 +@@ -0,0 +1,633 @@ +/* + * Copyright (C) 2005-2012 Junjiro R. Okajima + * @@ -6555,9 +6478,6 @@ + finfo = au_fi(file); + fidir = finfo->fi_hdir; + if (fidir) { -+ /* remove me from sb->s_files */ -+ file_sb_list_del(file); -+ + vdir_cache = fidir->fd_vdir_cache; /* lock-free */ + if (vdir_cache) + au_vdir_free(vdir_cache); @@ -7107,8 +7027,8 @@ +#endif /* __KERNEL__ */ +#endif /* __AUFS_DIR_H__ */ --- a/fs/aufs/dynop.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/dynop.c 2012-01-10 02:15:56.549455982 +0000 -@@ -0,0 +1,377 @@ ++++ b/fs/aufs/dynop.c 2012-10-10 02:27:30.006284153 +0100 +@@ -0,0 +1,379 @@ +/* + * Copyright (C) 2010-2012 Junjiro R. Okajima + * @@ -7305,6 +7225,8 @@ + DySetAop(launder_page); + DySetAop(is_partially_uptodate); + DySetAop(error_remove_page); ++ DySetAop(swap_activate); ++ DySetAop(swap_deactivate); + + DyDbgSize(cnt, *h_aop); + dyaop->da_get_xip_mem = h_aop->get_xip_mem; @@ -7566,8 +7488,8 @@ +#endif /* __KERNEL__ */ +#endif /* __AUFS_DYNOP_H__ */ --- a/fs/aufs/export.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/export.c 2012-07-22 01:31:00.162115458 +0100 -@@ -0,0 +1,810 @@ ++++ b/fs/aufs/export.c 2012-10-10 02:27:30.006284153 +0100 +@@ -0,0 +1,811 @@ +/* + * Copyright (C) 2005-2012 Junjiro R. Okajima + * @@ -7781,6 +7703,7 @@ + struct dentry *dentry, *d; + struct inode *inode; + unsigned int sigen; ++ struct hlist_node *p; + + dentry = NULL; + inode = ilookup(sb, ino); @@ -7799,7 +7722,7 @@ + dentry = d_find_alias(inode); + else { + spin_lock(&inode->i_lock); -+ list_for_each_entry(d, &inode->i_dentry, d_alias) { ++ hlist_for_each_entry(d, p, &inode->i_dentry, d_alias) { + spin_lock(&d->d_lock); + if (!au_test_anon(d) + && d->d_parent->d_inode->i_ino == dir_ino) { @@ -7953,7 +7876,7 @@ + if (!arg.found) + goto out_name; + -+ /* do not call au_lkup_one() */ ++ /* do not call vfsub_lkup_one() */ + dir = parent->d_inode; + mutex_lock(&dir->i_mutex); + dentry = vfsub_lookup_one_len(arg.name, parent, arg.namelen); @@ -8379,8 +8302,8 @@ + atomic_set(&sbinfo->si_xigen_next, u); +} --- a/fs/aufs/f_op.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/f_op.c 2012-08-01 03:41:52.619414717 +0100 -@@ -0,0 +1,727 @@ ++++ b/fs/aufs/f_op.c 2012-10-10 02:27:30.006284153 +0100 +@@ -0,0 +1,724 @@ +/* + * Copyright (C) 2005-2012 Junjiro R. Okajima + * @@ -8466,11 +8389,8 @@ + + finfo = au_fi(file); + bindex = finfo->fi_btop; -+ if (bindex >= 0) { -+ /* remove me from sb->s_files */ -+ file_sb_list_del(file); ++ if (bindex >= 0) + au_set_h_fptr(file, bindex, NULL); -+ } + + au_finfo_fin(file); + return 0; @@ -9407,8 +9327,8 @@ + return ret; +} --- a/fs/aufs/file.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/file.c 2012-06-04 21:49:59.854840268 +0100 -@@ -0,0 +1,676 @@ ++++ b/fs/aufs/file.c 2012-10-10 02:27:30.018284201 +0100 +@@ -0,0 +1,683 @@ +/* + * Copyright (C) 2005-2012 Junjiro R. Okajima + * @@ -10063,6 +9983,11 @@ +static int aufs_error_remove_page(struct address_space *mapping, + struct page *page) +{ AuUnsupport(); return 0; } ++static int aufs_swap_activate(struct swap_info_struct *sis, struct file *file, ++ sector_t *span) ++{ AuUnsupport(); return 0; } ++static void aufs_swap_deactivate(struct file *file) ++{ AuUnsupport(); } +#endif /* CONFIG_AUFS_DEBUG */ + +const struct address_space_operations aufs_aop = { @@ -10082,7 +10007,9 @@ + .migratepage = aufs_migratepage, + .launder_page = aufs_launder_page, + .is_partially_uptodate = aufs_is_partially_uptodate, -+ .error_remove_page = aufs_error_remove_page ++ .error_remove_page = aufs_error_remove_page, ++ .swap_activate = aufs_swap_activate, ++ .swap_deactivate = aufs_swap_deactivate +#endif /* CONFIG_AUFS_DEBUG */ +}; --- a/fs/aufs/file.h 1970-01-01 01:00:00.000000000 +0100 @@ -10546,8 +10473,8 @@ + return err; +} --- a/fs/aufs/fstype.h 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/fstype.h 2012-01-10 02:15:56.553455997 +0000 -@@ -0,0 +1,496 @@ ++++ b/fs/aufs/fstype.h 2012-10-10 02:27:30.018284201 +0100 +@@ -0,0 +1,481 @@ +/* + * Copyright (C) 2005-2012 Junjiro R. Okajima + * @@ -10889,16 +10816,6 @@ + || au_test_aufs(sb); /* will be supported in next version */ +} + -+/* -+ * If the filesystem supports NFS-export, then it has to support NULL as -+ * a nameidata parameter for ->create(), ->lookup() and ->d_revalidate(). -+ * We can apply this principle when we handle a lower filesystem. -+ */ -+static inline int au_test_fs_null_nd(struct super_block *sb) -+{ -+ return !!sb->s_export_op; -+} -+ +static inline int au_test_fs_remote(struct super_block *sb) +{ + return !au_test_tmpfs(sb) @@ -11014,11 +10931,6 @@ +{ + return au_test_fs_remote(sb) + || au_test_fs_bad_iattr_size(sb) -+#ifdef CONFIG_AUFS_BR_RAMFS -+ || !(au_test_ramfs(sb) || au_test_fs_null_nd(sb)) -+#else -+ || !au_test_fs_null_nd(sb) /* to keep xino code simple */ -+#endif + /* don't want unnecessary work for xino */ + || au_test_aufs(sb) + || au_test_ecryptfs(sb) @@ -11365,8 +11277,8 @@ + } +} --- a/fs/aufs/hnotify.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/hnotify.c 2012-07-22 01:31:00.162115458 +0100 -@@ -0,0 +1,712 @@ ++++ b/fs/aufs/hnotify.c 2012-10-10 02:27:30.018284201 +0100 +@@ -0,0 +1,713 @@ +/* + * Copyright (C) 2005-2012 Junjiro R. Okajima + * @@ -11569,6 +11481,7 @@ + int err; + struct dentry *d; + struct qstr *dname; ++ struct hlist_node *p; + + err = 1; + if (unlikely(inode->i_ino == AUFS_ROOT_INO)) { @@ -11581,7 +11494,7 @@ + AuDebugOn(!name); + au_iigen_dec(inode); + spin_lock(&inode->i_lock); -+ list_for_each_entry(d, &inode->i_dentry, d_alias) { ++ hlist_for_each_entry(d, p, &inode->i_dentry, d_alias) { + spin_lock(&d->d_lock); + dname = &d->d_name; + if (dname->len != nlen @@ -12080,7 +11993,7 @@ + au_hn_destroy_cache(); +} --- a/fs/aufs/i_op.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/i_op.c 2012-08-01 03:41:52.619414717 +0100 ++++ b/fs/aufs/i_op.c 2012-10-10 02:27:30.018284201 +0100 @@ -0,0 +1,1009 @@ +/* + * Copyright (C) 2005-2012 Junjiro R. Okajima @@ -12238,7 +12151,7 @@ +/* ---------------------------------------------------------------------- */ + +static struct dentry *aufs_lookup(struct inode *dir, struct dentry *dentry, -+ struct nameidata *nd) ++ unsigned int flags) +{ + struct dentry *ret, *parent; + struct inode *inode; @@ -12270,7 +12183,7 @@ + err = au_digen_test(parent, au_sigen(sb)); + if (!err) { + npositive = au_lkup_dentry(dentry, au_dbstart(parent), -+ /*type*/0, nd); ++ /*type*/0, flags); + err = npositive; + } + di_read_unlock(parent, AuLock_IR); @@ -12442,7 +12355,7 @@ +void au_unpin(struct au_pin *p) +{ + if (p->h_mnt && au_ftest_pin(p->flags, MNT_WRITE)) -+ mnt_drop_write(p->h_mnt); ++ vfsub_mnt_drop_write(p->h_mnt); + if (!p->hdir) + return; + @@ -12470,7 +12383,7 @@ + if (IS_ROOT(p->dentry)) { + if (au_ftest_pin(p->flags, MNT_WRITE)) { + p->h_mnt = br->br_mnt; -+ err = mnt_want_write(p->h_mnt); ++ err = vfsub_mnt_want_write(p->h_mnt); + if (unlikely(err)) { + au_fclr_pin(p->flags, MNT_WRITE); + goto out_err; @@ -12524,7 +12437,7 @@ + + if (au_ftest_pin(p->flags, MNT_WRITE)) { + p->h_mnt = br->br_mnt; -+ err = mnt_want_write(p->h_mnt); ++ err = vfsub_mnt_want_write(p->h_mnt); + if (unlikely(err)) { + au_fclr_pin(p->flags, MNT_WRITE); + goto out_unpin; @@ -13018,7 +12931,6 @@ +out_name: + __putname(buf.k); +out: -+ path_put(&nd->path); + AuTraceErr(err); + return ERR_PTR(err); +} @@ -13082,6 +12994,7 @@ + .getattr = aufs_getattr, + + .update_time = aufs_update_time ++ /* no support for atomic_open() */ +}; + +struct inode_operations aufs_iop = { @@ -13092,7 +13005,7 @@ + .update_time = aufs_update_time +}; --- a/fs/aufs/i_op_add.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/i_op_add.c 2012-06-04 21:49:59.854840268 +0100 ++++ b/fs/aufs/i_op_add.c 2012-10-10 02:27:30.018284201 +0100 @@ -0,0 +1,712 @@ +/* + * Copyright (C) 2005-2012 Junjiro R. Okajima @@ -13312,7 +13225,7 @@ + union { + struct { + umode_t mode; -+ struct nameidata *nd; ++ bool want_excl; + } c; + struct { + const char *symname; @@ -13363,7 +13276,7 @@ + h_dir = au_pinned_h_dir(&pin); + switch (arg->type) { + case Creat: -+ err = vfsub_create(h_dir, &h_path, arg->u.c.mode); ++ err = vfsub_create(h_dir, &h_path, arg->u.c.mode, arg->u.c.want_excl); + break; + case Symlink: + err = vfsub_symlink(h_dir, &h_path, arg->u.s.symname); @@ -13428,13 +13341,13 @@ +} + +int aufs_create(struct inode *dir, struct dentry *dentry, umode_t mode, -+ struct nameidata *nd) ++ bool want_excl) +{ + struct simple_arg arg = { + .type = Creat, + .u.c = { -+ .mode = mode, -+ .nd = nd ++ .mode = mode, ++ .want_excl = want_excl + } + }; + return add_simple(dir, dentry, &arg); @@ -13807,7 +13720,7 @@ + return err; +} --- a/fs/aufs/i_op_del.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/i_op_del.c 2012-01-10 02:15:56.557456016 +0000 ++++ b/fs/aufs/i_op_del.c 2012-10-10 02:27:30.018284201 +0100 @@ -0,0 +1,478 @@ +/* + * Copyright (C) 2005-2012 Junjiro R. Okajima @@ -13880,7 +13793,7 @@ + au_di_swap(tmp, dinfo); + /* returns the number of positive dentries */ + need_wh = au_lkup_dentry(dentry, bstart + 1, /*type*/0, -+ /*nd*/NULL); ++ /*flags*/0); + au_di_swap(tmp, dinfo); + au_rw_write_unlock(&tmp->di_rwsem); + au_di_free(tmp); @@ -14288,7 +14201,7 @@ + return err; +} --- a/fs/aufs/i_op_ren.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/i_op_ren.c 2012-07-22 01:31:00.162115458 +0100 ++++ b/fs/aufs/i_op_ren.c 2012-10-10 02:27:30.018284201 +0100 @@ -0,0 +1,1026 @@ +/* + * Copyright (C) 2005-2012 Junjiro R. Okajima @@ -14411,11 +14324,11 @@ +{ + int rerr; + -+ a->h_path.dentry = au_lkup_one(&a->src_dentry->d_name, a->src_h_parent, -+ a->br, /*nd*/NULL); ++ a->h_path.dentry = vfsub_lkup_one(&a->src_dentry->d_name, ++ a->src_h_parent); + rerr = PTR_ERR(a->h_path.dentry); + if (IS_ERR(a->h_path.dentry)) { -+ RevertFailure("au_lkup_one %.*s", AuDLNPair(a->src_dentry)); ++ RevertFailure("lkup one %.*s", AuDLNPair(a->src_dentry)); + return; + } + @@ -14445,11 +14358,11 @@ +{ + int rerr; + -+ a->h_path.dentry = au_lkup_one(&a->dst_dentry->d_name, a->dst_h_parent, -+ a->br, /*nd*/NULL); ++ a->h_path.dentry = vfsub_lkup_one(&a->dst_dentry->d_name, ++ a->dst_h_parent); + rerr = PTR_ERR(a->h_path.dentry); + if (IS_ERR(a->h_path.dentry)) { -+ RevertFailure("lookup %.*s", AuDLNPair(a->dst_dentry)); ++ RevertFailure("lkup one %.*s", AuDLNPair(a->dst_dentry)); + return; + } + if (a->h_path.dentry->d_inode) { @@ -14906,7 +14819,7 @@ + + sb = a->dst_dentry->d_sb; + if (au_ftest_ren(a->flags, MNT_WRITE)) -+ mnt_drop_write(a->br->br_mnt); ++ vfsub_mnt_drop_write(a->br->br_mnt); + vfsub_unlock_rename(a->src_h_parent, a->src_hdir, + a->dst_h_parent, a->dst_hdir); +} @@ -14936,7 +14849,7 @@ + a->dst_h_parent->d_inode, a->dst_h_parent, + a->br); + if (!err) { -+ err = mnt_want_write(a->br->br_mnt); ++ err = vfsub_mnt_want_write(a->br->br_mnt); + if (unlikely(err)) + goto out_unlock; + au_fset_ren(a->flags, MNT_WRITE); @@ -15584,7 +15497,7 @@ + AuRwDestroy(&iinfo->ii_rwsem); +} --- a/fs/aufs/inode.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/inode.c 2012-08-01 04:08:08.827230713 +0100 ++++ b/fs/aufs/inode.c 2012-10-10 02:27:30.018284201 +0100 @@ -0,0 +1,478 @@ +/* + * Copyright (C) 2005-2012 Junjiro R. Okajima @@ -16051,7 +15964,7 @@ + +int au_test_h_perm(struct inode *h_inode, int mask) +{ -+ if (current_fsuid() == GLOBAL_ROOT_GID) ++ if (uid_eq(current_fsuid(), GLOBAL_ROOT_UID)) + return 0; + return inode_permission(h_inode, mask); +} @@ -16065,7 +15978,7 @@ + return au_test_h_perm(h_inode, mask); +} --- a/fs/aufs/inode.h 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/inode.h 2012-06-04 21:49:59.854840268 +0100 ++++ b/fs/aufs/inode.h 2012-10-10 02:27:30.022284240 +0100 @@ -0,0 +1,560 @@ +/* + * Copyright (C) 2005-2012 Junjiro R. Okajima @@ -16230,7 +16143,7 @@ + dev_t dev); +int aufs_symlink(struct inode *dir, struct dentry *dentry, const char *symname); +int aufs_create(struct inode *dir, struct dentry *dentry, umode_t mode, -+ struct nameidata *nd); ++ bool want_excl); +int aufs_link(struct dentry *src_dentry, struct inode *dir, + struct dentry *dentry); +int aufs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode); @@ -19272,7 +19185,7 @@ +#endif /* __KERNEL__ */ +#endif /* __AUFS_OPTS_H__ */ --- a/fs/aufs/plink.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/plink.c 2012-08-01 04:08:08.827230713 +0100 ++++ b/fs/aufs/plink.c 2012-10-10 02:27:30.022284240 +0100 @@ -0,0 +1,511 @@ +/* + * Copyright (C) 2005-2012 Junjiro R. Okajima @@ -19485,7 +19398,7 @@ + + h_mtx = &h_parent->d_inode->i_mutex; + mutex_lock_nested(h_mtx, AuLsc_I_CHILD2); -+ h_dentry = au_lkup_one(tgtname, h_parent, br, /*nd*/NULL); ++ h_dentry = vfsub_lkup_one(tgtname, h_parent); + mutex_unlock(h_mtx); + return h_dentry; +} @@ -19513,7 +19426,7 @@ + h_dir = h_parent->d_inode; + tgtname.len = plink_name(a, sizeof(a), inode, bindex); + -+ if (current_fsuid() != GLOBAL_ROOT_GID) { ++ if (!uid_eq(current_fsuid(), GLOBAL_ROOT_UID)) { + struct au_do_plink_lkup_args args = { + .errp = &h_dentry, + .tgtname = &tgtname, @@ -19543,7 +19456,7 @@ + h_dir = h_parent->d_inode; + mutex_lock_nested(&h_dir->i_mutex, AuLsc_I_CHILD2); +again: -+ h_path.dentry = au_lkup_one(tgt, h_parent, br, /*nd*/NULL); ++ h_path.dentry = vfsub_lkup_one(tgt, h_parent); + err = PTR_ERR(h_path.dentry); + if (IS_ERR(h_path.dentry)) + goto out; @@ -19598,7 +19511,7 @@ + tgtname.len = plink_name(a, sizeof(a), inode, bindex); + + /* always superio. */ -+ if (current_fsuid() != GLOBAL_ROOT_GID) { ++ if (!uid_eq(current_fsuid(), GLOBAL_ROOT_UID)) { + struct do_whplink_args args = { + .errp = &err, + .tgt = &tgtname, @@ -21007,7 +20920,7 @@ +#endif /* __KERNEL__ */ +#endif /* __AUFS_SPL_H__ */ --- a/fs/aufs/super.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/super.c 2012-06-04 21:49:59.854840268 +0100 ++++ b/fs/aufs/super.c 2012-10-10 02:27:30.022284240 +0100 @@ -0,0 +1,962 @@ +/* + * Copyright (C) 2005-2012 Junjiro R. Okajima @@ -21060,7 +20973,7 @@ +{ + struct inode *inode = container_of(head, struct inode, i_rcu); + -+ INIT_LIST_HEAD(&inode->i_dentry); ++ INIT_HLIST_HEAD(&inode->i_dentry); + au_cache_free_icntnr(container_of(inode, struct au_icntnr, vfs_inode)); +} + @@ -22996,7 +22909,7 @@ + } +} --- a/fs/aufs/sysrq.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/sysrq.c 2012-07-22 01:31:00.166115467 +0100 ++++ b/fs/aufs/sysrq.c 2012-10-10 02:27:30.022284240 +0100 @@ -0,0 +1,148 @@ +/* + * Copyright (C) 2005-2012 Junjiro R. Okajima @@ -23076,7 +22989,7 @@ + spin_lock(&inode_sb_list_lock); + list_for_each_entry(i, &sb->s_inodes, i_sb_list) { + spin_lock(&i->i_lock); -+ if (1 || list_empty(&i->i_dentry)) ++ if (1 || hlist_empty(&i->i_dentry)) + au_dpri_inode(i); + spin_unlock(&i->i_lock); + } @@ -24035,8 +23948,8 @@ + return 0; +} --- a/fs/aufs/vfsub.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/vfsub.c 2012-06-04 21:49:59.854840268 +0100 -@@ -0,0 +1,832 @@ ++++ b/fs/aufs/vfsub.c 2012-10-10 02:27:30.022284240 +0100 +@@ -0,0 +1,777 @@ +/* + * Copyright (C) 2005-2012 Junjiro R. Okajima + * @@ -24091,9 +24004,7 @@ +{ + struct file *file; + -+ path_get(path); -+ file = dentry_open(path->dentry, path->mnt, -+ flags /* | __FMODE_NONOTIFY */, ++ file = dentry_open(path, flags /* | __FMODE_NONOTIFY */, + current_cred()); + if (!IS_ERR_OR_NULL(file) + && (file->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ) @@ -24150,48 +24061,10 @@ + return path.dentry; +} + -+struct dentry *vfsub_lookup_hash(struct nameidata *nd) ++void vfsub_call_lkup_one(void *args) +{ -+ struct path path = { -+ .mnt = nd->path.mnt -+ }; -+ -+ IMustLock(nd->path.dentry->d_inode); -+ -+ path.dentry = lookup_hash(nd); -+ if (IS_ERR(path.dentry)) -+ goto out; -+ if (path.dentry->d_inode) -+ vfsub_update_h_iattr(&path, /*did*/NULL); /*ignore*/ -+ -+out: -+ AuTraceErrPtr(path.dentry); -+ return path.dentry; -+} -+ -+/* -+ * this is "VFS:__lookup_one_len()" which was removed and merged into -+ * VFS:lookup_one_len() by the commit. -+ * 6a96ba5 2011-03-14 kill __lookup_one_len() -+ * this function should always be equivalent to the corresponding part in -+ * VFS:lookup_one_len(). -+ */ -+int vfsub_name_hash(const char *name, struct qstr *this, int len) -+{ -+ unsigned int c; -+ -+ this->name = name; -+ this->len = len; -+ this->hash = full_name_hash(name, len); -+ if (!len) -+ return -EACCES; -+ -+ while (len--) { -+ c = *(const unsigned char *)name++; -+ if (c == '/' || c == '\0') -+ return -EACCES; -+ } -+ return 0; ++ struct vfsub_lkup_one_args *a = args; ++ *a->errp = vfsub_lkup_one(a->name, a->parent); +} + +/* ---------------------------------------------------------------------- */ @@ -24224,7 +24097,7 @@ + +/* ---------------------------------------------------------------------- */ + -+int vfsub_create(struct inode *dir, struct path *path, int mode) ++int vfsub_create(struct inode *dir, struct path *path, int mode, bool want_excl) +{ + int err; + struct dentry *d; @@ -24238,23 +24111,7 @@ + if (unlikely(err)) + goto out; + -+ if (au_test_fs_null_nd(dir->i_sb)) -+ err = vfs_create(dir, path->dentry, mode, NULL); -+ else { -+ struct nameidata h_nd; -+ -+ memset(&h_nd, 0, sizeof(h_nd)); -+ h_nd.flags = LOOKUP_CREATE; -+ h_nd.intent.open.flags = O_CREAT -+ | vfsub_fmode_to_uint(FMODE_READ); -+ h_nd.intent.open.create_mode = mode; -+ h_nd.path.dentry = path->dentry->d_parent; -+ h_nd.path.mnt = path->mnt; -+ path_get(&h_nd.path); -+ err = vfs_create(dir, path->dentry, mode, &h_nd); -+ path_put(&h_nd.path); -+ } -+ ++ err = vfs_create(dir, path->dentry, mode, want_excl); + if (!err) { + struct path tmp = *path; + int did; @@ -24354,6 +24211,7 @@ + if (unlikely(err)) + return err; + ++ /* we don't call may_linkat() */ + d = path->dentry; + path->dentry = d->d_parent; + err = security_path_link(src_dentry, path, d); @@ -24637,7 +24495,7 @@ + + h_inode = h_path->dentry->d_inode; + if (!h_file) { -+ err = mnt_want_write(h_path->mnt); ++ err = vfsub_mnt_want_write(h_path->mnt); + if (err) + goto out; + err = inode_permission(h_inode, MAY_WRITE); @@ -24665,7 +24523,7 @@ + put_write_access(h_inode); +out_mnt: + if (!h_file) -+ mnt_drop_write(h_path->mnt); ++ vfsub_mnt_drop_write(h_path->mnt); +out: + return err; +} @@ -24870,8 +24728,8 @@ + return err; +} --- a/fs/aufs/vfsub.h 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/vfsub.h 2012-07-22 01:31:00.166115467 +0100 -@@ -0,0 +1,252 @@ ++++ b/fs/aufs/vfsub.h 2012-10-10 02:27:30.022284240 +0100 +@@ -0,0 +1,283 @@ +/* + * Copyright (C) 2005-2012 Junjiro R. Okajima + * @@ -24901,12 +24759,12 @@ + +#include +#include ++#include +#include "debug.h" + +/* copied from linux/fs/internal.h */ +/* todo: BAD approach!! */ +extern struct lglock vfsmount_lock; -+extern void file_sb_list_del(struct file *f); +extern spinlock_t inode_sb_list_lock; + +/* copied from linux/fs/file_table.c */ @@ -24993,10 +24851,41 @@ +struct file *vfsub_dentry_open(struct path *path, int flags); +struct file *vfsub_filp_open(const char *path, int oflags, int mode); +int vfsub_kern_path(const char *name, unsigned int flags, struct path *path); ++ +struct dentry *vfsub_lookup_one_len(const char *name, struct dentry *parent, + int len); -+struct dentry *vfsub_lookup_hash(struct nameidata *nd); -+int vfsub_name_hash(const char *name, struct qstr *this, int len); ++ ++struct vfsub_lkup_one_args { ++ struct dentry **errp; ++ struct qstr *name; ++ struct dentry *parent; ++}; ++ ++static inline struct dentry *vfsub_lkup_one(struct qstr *name, ++ struct dentry *parent) ++{ ++ return vfsub_lookup_one_len(name->name, parent, name->len); ++} ++ ++void vfsub_call_lkup_one(void *args); ++ ++/* ---------------------------------------------------------------------- */ ++ ++static inline int vfsub_mnt_want_write(struct vfsmount *mnt) ++{ ++ int err; ++ lockdep_off(); ++ err = mnt_want_write(mnt); ++ lockdep_on(); ++ return err; ++} ++ ++static inline void vfsub_mnt_drop_write(struct vfsmount *mnt) ++{ ++ lockdep_off(); ++ mnt_drop_write(mnt); ++ lockdep_on(); ++} + +/* ---------------------------------------------------------------------- */ + @@ -25006,7 +24895,7 @@ +void vfsub_unlock_rename(struct dentry *d1, struct au_hinode *hdir1, + struct dentry *d2, struct au_hinode *hdir2); + -+int vfsub_create(struct inode *dir, struct path *path, int mode); ++int vfsub_create(struct inode *dir, struct path *path, int mode, bool want_excl); +int vfsub_symlink(struct inode *dir, struct path *path, + const char *symname); +int vfsub_mknod(struct inode *dir, struct path *path, int mode, dev_t dev); @@ -25828,8 +25717,8 @@ + } +}; --- a/fs/aufs/whout.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/whout.c 2012-07-22 01:31:00.166115467 +0100 -@@ -0,0 +1,1041 @@ ++++ b/fs/aufs/whout.c 2012-10-10 02:27:30.022284240 +0100 +@@ -0,0 +1,1042 @@ +/* + * Copyright (C) 2005-2012 Junjiro R. Okajima + * @@ -25903,7 +25792,7 @@ + struct dentry *wh_dentry; + + if (!try_sio) -+ wh_dentry = au_lkup_one(wh_name, h_parent, br, /*nd*/NULL); ++ wh_dentry = vfsub_lkup_one(wh_name, h_parent); + else + wh_dentry = au_sio_lkup_one(wh_name, h_parent, br); + err = PTR_ERR(wh_dentry); @@ -26069,7 +25958,7 @@ + }; + + err = 0; -+ h_path.dentry = au_lkup_one(wh, h_parent, br, /*nd*/NULL); ++ h_path.dentry = vfsub_lkup_one(wh, h_parent); + if (IS_ERR(h_path.dentry)) + err = PTR_ERR(h_path.dentry); + else { @@ -26095,13 +25984,13 @@ + if (!whpath->dentry->d_inode) + return; + -+ err = mnt_want_write(whpath->mnt); ++ err = vfsub_mnt_want_write(whpath->mnt); + if (!err) { + if (isdir) + err = vfsub_rmdir(h_dir, whpath); + else + err = vfsub_unlink(h_dir, whpath, /*force*/0); -+ mnt_drop_write(whpath->mnt); ++ vfsub_mnt_drop_write(whpath->mnt); + } + if (unlikely(err)) + pr_warn("failed removing %.*s (%d), ignored.\n", @@ -26131,10 +26020,10 @@ + + if (au_test_nfs(path->dentry->d_sb)) + mode |= S_IXUGO; -+ err = mnt_want_write(path->mnt); ++ err = vfsub_mnt_want_write(path->mnt); + if (!err) { + err = vfsub_mkdir(h_dir, path, mode); -+ mnt_drop_write(path->mnt); ++ vfsub_mnt_drop_write(path->mnt); + } + } else if (S_ISDIR(path->dentry->d_inode->i_mode)) + err = 0; @@ -26229,11 +26118,12 @@ + err = -EEXIST; + h_dir = h_root->d_inode; + if (!base[AuBrWh_BASE].dentry->d_inode) { -+ err = mnt_want_write(h_path->mnt); ++ err = vfsub_mnt_want_write(h_path->mnt); + if (!err) { + h_path->dentry = base[AuBrWh_BASE].dentry; -+ err = vfsub_create(h_dir, h_path, WH_MASK); -+ mnt_drop_write(h_path->mnt); ++ err = vfsub_create(h_dir, h_path, WH_MASK, ++ /*want_excl*/true); ++ vfsub_mnt_drop_write(h_path->mnt); + } + } else if (S_ISREG(base[AuBrWh_BASE].dentry->d_inode->i_mode)) + err = 0; @@ -26395,12 +26285,12 @@ + err = au_h_verify(wbr->wbr_whbase, au_opt_udba(a->sb), hdir->hi_inode, + h_root, a->br); + if (!err) { -+ err = mnt_want_write(a->br->br_mnt); ++ err = vfsub_mnt_want_write(a->br->br_mnt); + if (!err) { + h_path.dentry = wbr->wbr_whbase; + h_path.mnt = a->br->br_mnt; + err = vfsub_unlink(hdir->hi_inode, &h_path, /*force*/0); -+ mnt_drop_write(a->br->br_mnt); ++ vfsub_mnt_drop_write(a->br->br_mnt); + } + } else { + pr_warn("%.*s is moved, ignored\n", @@ -26494,7 +26384,7 @@ + } + + /* return this error in this context */ -+ err = vfsub_create(h_dir, &h_path, WH_MASK); ++ err = vfsub_create(h_dir, &h_path, WH_MASK, /*want_excl*/true); + +out: + wbr_wh_read_unlock(wbr); @@ -26517,7 +26407,7 @@ + sb = dentry->d_sb; + br = au_sbr(sb, bindex); + h_dentry = au_h_dptr(dentry, bindex); -+ opq_dentry = au_lkup_one(&diropq_name, h_dentry, br, /*nd*/NULL); ++ opq_dentry = vfsub_lkup_one(&diropq_name, h_dentry); + if (IS_ERR(opq_dentry)) + goto out; + @@ -26599,7 +26489,7 @@ + err = au_wh_name_alloc(&wh_name, base_name); + wh_dentry = ERR_PTR(err); + if (!err) { -+ wh_dentry = au_lkup_one(&wh_name, h_parent, br, /*nd*/NULL); ++ wh_dentry = vfsub_lkup_one(&wh_name, h_parent); + kfree(wh_name.name); + } + return wh_dentry; @@ -26830,11 +26720,11 @@ + err = au_h_verify(a->wh_dentry, au_opt_udba(sb), h_dir, h_parent, + a->br); + if (!err) { -+ err = mnt_want_write(a->br->br_mnt); ++ err = vfsub_mnt_want_write(a->br->br_mnt); + if (!err) { + err = au_whtmp_rmdir(a->dir, bindex, a->wh_dentry, + &a->whlist); -+ mnt_drop_write(a->br->br_mnt); ++ vfsub_mnt_drop_write(a->br->br_mnt); + } + } + au_hn_imtx_unlock(hdir); @@ -26963,7 +26853,7 @@ +#endif /* __KERNEL__ */ +#endif /* __AUFS_WHOUT_H__ */ --- a/fs/aufs/wkq.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/wkq.c 2012-08-01 04:08:08.831230728 +0100 ++++ b/fs/aufs/wkq.c 2012-10-10 02:27:30.022284240 +0100 @@ -0,0 +1,214 @@ +/* + * Copyright (C) 2005-2012 Junjiro R. Okajima @@ -27013,7 +26903,7 @@ +{ + struct au_wkinfo *wkinfo = container_of(wk, struct au_wkinfo, wk); + -+ AuDebugOn(current_fsuid() != GLOBAL_ROOT_GID); ++ AuDebugOn(!uid_eq(current_fsuid(), GLOBAL_ROOT_UID)); + AuDebugOn(rlimit(RLIMIT_FSIZE) != RLIM_INFINITY); + + wkinfo->func(wkinfo->args); @@ -28542,7 +28432,7 @@ + return err; +} --- a/include/linux/aufs_type.h 1970-01-01 01:00:00.000000000 +0100 -+++ b/include/linux/aufs_type.h 2012-08-01 03:41:52.619414717 +0100 ++++ b/include/linux/aufs_type.h 2012-10-10 02:27:30.022284240 +0100 @@ -0,0 +1,233 @@ +/* + * Copyright (C) 2005-2012 Junjiro R. Okajima @@ -28585,7 +28475,7 @@ + +#include + -+#define AUFS_VERSION "3.5-20120730" ++#define AUFS_VERSION "3.x-rcN-20120827" + +/* todo? move this to linux-2.6.19/include/magic.h */ +#define AUFS_SUPER_MAGIC ('a' << 24 | 'u' << 16 | 'f' << 8 | 's') diff --git a/debian/patches/features/all/aufs3/aufs3-base.patch b/debian/patches/features/all/aufs3/aufs3-base.patch index 94a6d9aea..7fa262008 100644 --- a/debian/patches/features/all/aufs3/aufs3-base.patch +++ b/debian/patches/features/all/aufs3/aufs3-base.patch @@ -1,7 +1,7 @@ -aufs3.5 base patch +aufs3.x-rcN base patch diff --git a/fs/inode.c b/fs/inode.c -index c99163b..7f772fd 100644 +index ac8d904..7b2c8fa 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -1491,7 +1491,7 @@ static int relatime_need_update(struct vfsmount *mnt, struct inode *inode, @@ -13,24 +13,11 @@ index c99163b..7f772fd 100644 { if (inode->i_op->update_time) return inode->i_op->update_time(inode, time, flags); -diff --git a/fs/namei.c b/fs/namei.c -index 7d69419..18c9782 100644 ---- a/fs/namei.c -+++ b/fs/namei.c -@@ -1864,7 +1864,7 @@ int vfs_path_lookup(struct dentry *dentry, struct vfsmount *mnt, - * needs parent already locked. Doesn't follow mounts. - * SMP-safe. - */ --static struct dentry *lookup_hash(struct nameidata *nd) -+struct dentry *lookup_hash(struct nameidata *nd) - { - return __lookup_hash(&nd->last, nd->path.dentry, nd); - } diff --git a/fs/splice.c b/fs/splice.c -index 7bf08fa..e3c40b5 100644 +index 41514dd..663b402 100644 --- a/fs/splice.c +++ b/fs/splice.c -@@ -1090,8 +1090,8 @@ EXPORT_SYMBOL(generic_splice_sendpage); +@@ -1093,8 +1093,8 @@ EXPORT_SYMBOL(generic_splice_sendpage); /* * Attempt to initiate a splice from pipe to file. */ @@ -41,7 +28,7 @@ index 7bf08fa..e3c40b5 100644 { ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int); -@@ -1118,9 +1118,9 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out, +@@ -1121,9 +1121,9 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out, /* * Attempt to initiate a splice from a file to a pipe. */ @@ -55,10 +42,10 @@ index 7bf08fa..e3c40b5 100644 ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int); diff --git a/include/linux/fs.h b/include/linux/fs.h -index 17fd887..9c75a47 100644 +index aa11047..9116d2e 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h -@@ -2591,6 +2591,7 @@ extern int inode_change_ok(const struct inode *, struct iattr *); +@@ -2741,6 +2741,7 @@ extern int inode_change_ok(const struct inode *, struct iattr *); extern int inode_newsize_ok(const struct inode *, loff_t offset); extern void setattr_copy(struct inode *inode, const struct iattr *attr); @@ -66,18 +53,6 @@ index 17fd887..9c75a47 100644 extern int file_update_time(struct file *file); extern int generic_show_options(struct seq_file *m, struct dentry *root); -diff --git a/include/linux/namei.h b/include/linux/namei.h -index ffc0213..ef35a31 100644 ---- a/include/linux/namei.h -+++ b/include/linux/namei.h -@@ -85,6 +85,7 @@ extern int vfs_path_lookup(struct dentry *, struct vfsmount *, - extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry, - int (*open)(struct inode *, struct file *)); - -+extern struct dentry *lookup_hash(struct nameidata *nd); - extern struct dentry *lookup_one_len(const char *, struct dentry *, int); - - extern int follow_down_one(struct path *); diff --git a/include/linux/splice.h b/include/linux/splice.h index 09a545a..1ac5727 100644 --- a/include/linux/splice.h diff --git a/debian/patches/features/all/aufs3/aufs3-kbuild.patch b/debian/patches/features/all/aufs3/aufs3-kbuild.patch index ba6d30d66..d28eb1267 100644 --- a/debian/patches/features/all/aufs3/aufs3-kbuild.patch +++ b/debian/patches/features/all/aufs3/aufs3-kbuild.patch @@ -1,4 +1,4 @@ -aufs3.5 kbuild patch +aufs3.x-rcN kbuild patch diff --git a/fs/Kconfig b/fs/Kconfig index f95ae3a..6d8a9a5 100644 @@ -22,7 +22,7 @@ index 2fb9779..abefac5 100644 obj-$(CONFIG_PSTORE) += pstore/ +obj-$(CONFIG_AUFS_FS) += aufs/ diff --git a/include/linux/Kbuild b/include/linux/Kbuild -index 8760be3..a1b8446 100644 +index fa21760..ee029e3 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild @@ -66,6 +66,7 @@ header-y += atmppp.h diff --git a/debian/patches/features/all/aufs3/aufs3-standalone.patch b/debian/patches/features/all/aufs3/aufs3-standalone.patch index fb5b4b765..db132ae87 100644 --- a/debian/patches/features/all/aufs3/aufs3-standalone.patch +++ b/debian/patches/features/all/aufs3/aufs3-standalone.patch @@ -1,10 +1,10 @@ -aufs3.5 standalone patch +aufs3.x-rcN standalone patch diff --git a/fs/file_table.c b/fs/file_table.c -index a305d9e..6a768be 100644 +index 701985e..a9fe741 100644 --- a/fs/file_table.c +++ b/fs/file_table.c -@@ -35,6 +35,7 @@ struct files_stat_struct files_stat = { +@@ -37,6 +37,7 @@ struct files_stat_struct files_stat = { }; DEFINE_LGLOCK(files_lglock); @@ -12,7 +12,7 @@ index a305d9e..6a768be 100644 /* SLAB cache for file structures */ static struct kmem_cache *filp_cachep __read_mostly; -@@ -441,6 +442,8 @@ void file_sb_list_del(struct file *file) +@@ -509,6 +510,8 @@ void file_sb_list_del(struct file *file) } } @@ -22,7 +22,7 @@ index a305d9e..6a768be 100644 /* diff --git a/fs/inode.c b/fs/inode.c -index 7f772fd..e789d2f 100644 +index 7b2c8fa..0c4318d 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -56,6 +56,7 @@ static struct hlist_head *inode_hashtable __read_mostly; @@ -41,20 +41,8 @@ index 7f772fd..e789d2f 100644 /** * touch_atime - update the access time -diff --git a/fs/namei.c b/fs/namei.c -index 18c9782..f09edf3 100644 ---- a/fs/namei.c -+++ b/fs/namei.c -@@ -1868,6 +1868,7 @@ struct dentry *lookup_hash(struct nameidata *nd) - { - return __lookup_hash(&nd->last, nd->path.dentry, nd); - } -+EXPORT_SYMBOL_GPL(lookup_hash); - - /** - * lookup_one_len - filesystem helper to lookup single pathname component diff --git a/fs/namespace.c b/fs/namespace.c -index 1e4a5fe..06aa768 100644 +index 4d31f73..fe1eca1 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -50,6 +50,7 @@ EXPORT_SYMBOL_GPL(fs_kobj); @@ -65,7 +53,7 @@ index 1e4a5fe..06aa768 100644 static inline unsigned long hash(struct vfsmount *mnt, struct dentry *dentry) { -@@ -1341,6 +1342,7 @@ int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg, +@@ -1401,6 +1402,7 @@ int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg, } return 0; } @@ -135,7 +123,7 @@ index f104d56..54f36db 100644 static int fsnotify_mark_destroy(void *ignored) { diff --git a/fs/open.c b/fs/open.c -index 1540632..2463289 100644 +index e1f2cdb..2804cd6 100644 --- a/fs/open.c +++ b/fs/open.c @@ -60,6 +60,7 @@ int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs, @@ -147,10 +135,10 @@ index 1540632..2463289 100644 static long do_sys_truncate(const char __user *pathname, loff_t length) { diff --git a/fs/splice.c b/fs/splice.c -index e3c40b5..3afc547 100644 +index 663b402..51e1deb 100644 --- a/fs/splice.c +++ b/fs/splice.c -@@ -1114,6 +1114,7 @@ long do_splice_from(struct pipe_inode_info *pipe, struct file *out, +@@ -1117,6 +1117,7 @@ long do_splice_from(struct pipe_inode_info *pipe, struct file *out, return splice_write(pipe, out, ppos, len, flags); } @@ -158,7 +146,7 @@ index e3c40b5..3afc547 100644 /* * Attempt to initiate a splice from a file to a pipe. -@@ -1140,6 +1141,7 @@ long do_splice_to(struct file *in, loff_t *ppos, +@@ -1143,6 +1144,7 @@ long do_splice_to(struct file *in, loff_t *ppos, return splice_read(in, ppos, pipe, len, flags); } diff --git a/debian/patches/series b/debian/patches/series index d652ed39b..39984c174 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -8,12 +8,12 @@ features/all/sound-pci-cs46xx-request_firmware.patch # Patches and source files from aufs3 repository, imported with # debian/patches/features/all/aufs3/gen-patch. -#features/all/aufs3/aufs3-base.patch -#features/all/aufs3/aufs3-standalone.patch -#features/all/aufs3/aufs3-kbuild.patch -#features/all/aufs3/aufs3-add.patch +features/all/aufs3/aufs3-base.patch +features/all/aufs3/aufs3-standalone.patch +features/all/aufs3/aufs3-kbuild.patch +features/all/aufs3/aufs3-add.patch # mark as staging/crap -#features/all/aufs3/mark-as-staging.patch +features/all/aufs3/mark-as-staging.patch bugfix/ia64/hardcode-arch-script-output.patch bugfix/mips/disable-advansys.patch