diff --git a/debian/changelog b/debian/changelog index d42bd42a8..7db35403c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,14 @@ linux (3.14.8-1) UNRELEASED; urgency=medium stage - iser-target: Fix multi network portal shutdown regression + [ Ben Hutchings ] + * aufs: Update to aufs3.14-20140616: + - tiny, no msg in spinlock regeion + - minor bugfix, correct error value in link(2) + - O_TMPFILE support + - bugfix, handling an error in opening a FIFO + - propagate aufs file references to new vmas created by remap_file_pages() + -- Ben Hutchings Tue, 17 Jun 2014 16:44:33 +0100 linux (3.14.7-1) unstable; urgency=medium diff --git a/debian/patches/features/all/aufs3/aufs3-add.patch b/debian/patches/features/all/aufs3/aufs3-add.patch index 9a40e93b1..5b19e6361 100644 --- a/debian/patches/features/all/aufs3/aufs3-add.patch +++ b/debian/patches/features/all/aufs3/aufs3-add.patch @@ -1,7 +1,7 @@ From: J. R. Okajima -Date: Tue May 6 22:36:39 2014 +0900 -Subject: aufs3.14-20140512 -Origin: http://sourceforge.net/p/aufs/aufs3-standalone/ci/16de14a1266dc814561c755485f0b79efc6b25b5/tree/ +Date: Sun Jun 15 16:10:12 2014 +0900 +Subject: aufs3.14-20140616 +Origin: http://sourceforge.net/p/aufs/aufs3-standalone/ci/d201c504500b2091b88aa648e5163589e29b6822/tree/ Bug-Debian: https://bugs.debian.org/541828 Patch generated by debian/patches/features/all/aufs3/gen-patch @@ -94,8 +94,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + When the aufs mount option 'noxino' is specified, it + will be empty. About XINO files, see the aufs manual. --- a/Documentation/filesystems/aufs/README 1970-01-01 01:00:00.000000000 +0100 -+++ b/Documentation/filesystems/aufs/README 2014-05-13 19:05:05.248347320 +0100 -@@ -0,0 +1,345 @@ ++++ b/Documentation/filesystems/aufs/README 2014-06-17 18:23:40.779905015 +0100 +@@ -0,0 +1,368 @@ + +Aufs3 -- advanced multi layered unification filesystem version 3.x +http://aufs.sf.net @@ -118,10 +118,16 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch +aufs2-standalone.git repository, aufs1 from CVS on SourceForge. + +Note: it becomes clear that "Aufs was rejected. Let's give it up." -+According to Christoph Hellwig, linux rejects all union-type filesystems -+but UnionMount. ++ According to Christoph Hellwig, linux rejects all union-type ++ filesystems but UnionMount. + + ++PS. Al Viro seems have a plan to merge aufs as well as overlayfs and ++ UnionMount, and he pointed out an issue around a directory mutex ++ lock and aufs addressed it. But it is still unsure whether aufs will ++ be merged (or any other union solution). ++ ++ + +1. Features +---------------------------------------- @@ -326,6 +332,23 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + then run "make install_ulib" too. And refer to the aufs manual in + detail. + ++There several other patches in aufs3-standalone.git. They are all ++optional. When you meet some problems, they will help you. ++- aufs3-loopback.patch ++ Supports a nested loopback mount in a branch-fs. This patch is ++ unnecessary until aufs produces a message like "you may want to try ++ another patch for loopback file". ++- vfs-ino.patch ++ Modifies a system global kernel internal function get_next_ino() in ++ order to stop assigning 0 for an inode-number. Not directly related to ++ aufs, but recommended generally. ++- tmpfs-idr.patch ++ Keeps the tmpfs inode number as the lowest value. Effective to reduce ++ the size of aufs XINO files for tmpfs branch. Also it prevents the ++ duplication of inode number, which is important for backup tools and ++ other utilities. When you find aufs XINO files for tmpfs branch ++ growing too much, try this patch. ++ + +4. Usage +---------------------------------------- @@ -3234,8 +3257,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + +-include ${srctree}/${src}/conf_priv.mk --- a/fs/aufs/cpup.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/cpup.c 2014-01-20 03:24:33.508760970 +0000 -@@ -0,0 +1,1277 @@ ++++ b/fs/aufs/cpup.c 2014-06-17 18:23:40.783905015 +0100 +@@ -0,0 +1,1289 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * @@ -3299,8 +3322,11 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + + /* + * 0 can happen in revalidating. -+ * h_inode->i_mutex is not held, but it is harmless since once i_nlink -+ * reaches 0, it will never become positive. ++ * h_inode->i_mutex may not be held here, but it is harmless since once ++ * i_nlink reaches 0, it will never become positive except O_TMPFILE ++ * case. ++ * todo: O_TMPFILE+linkat(AT_SYMLINK_FOLLOW) bypassing aufs may cause ++ * the incorrect link count. + */ + set_nlink(inode, h_inode->i_nlink); + @@ -3650,7 +3676,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + int err, rerr; + loff_t l; + struct path h_path; -+ struct inode *h_src_inode; ++ struct inode *h_src_inode, *h_dst_inode; + + err = 0; + h_src_inode = au_h_iptr(cpg->dentry->d_inode, cpg->bsrc); @@ -3677,6 +3703,13 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + if (!err && rerr) + err = rerr; + } ++ if (!err && (h_src_inode->i_state & I_LINKABLE)) { ++ h_path.dentry = au_h_dptr(cpg->dentry, cpg->bdst); ++ h_dst_inode = h_path.dentry->d_inode; ++ spin_lock(&h_dst_inode->i_lock); ++ h_dst_inode->i_state |= I_LINKABLE; ++ spin_unlock(&h_dst_inode->i_lock); ++ } + +out: + return err; @@ -3799,7 +3832,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + if (!au_opt_test(mnt_flags, UDBA_NONE) + && !isdir + && au_opt_test(mnt_flags, XINO) -+ && h_inode->i_nlink == 1 ++ && (h_inode->i_nlink == 1 ++ || (h_inode->i_state & I_LINKABLE)) + /* todo: unnecessary? */ + /* && cpg->dentry->d_inode->i_nlink == 1 */ + && cpg->bdst < cpg->bsrc @@ -3991,7 +4025,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + goto out_rev; + + if (!isdir -+ && h_src->d_inode->i_nlink > 1 ++ && (h_src->d_inode->i_nlink > 1 ++ || h_src->d_inode->i_state & I_LINKABLE) + && plink) + au_plink_append(inode, cpg->bdst, h_dst); + @@ -5343,8 +5378,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + return path_is_under(path + 0, path + 1); +} --- a/fs/aufs/dcsub.h 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/dcsub.h 2014-01-20 03:24:33.508760970 +0000 -@@ -0,0 +1,98 @@ ++++ b/fs/aufs/dcsub.h 2014-06-17 18:23:40.783905015 +0100 +@@ -0,0 +1,116 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * @@ -5417,6 +5452,18 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + return err; +} + ++static inline int au_d_linkable(struct dentry *d) ++{ ++ int err; ++ struct inode *inode = d->d_inode; ++ err = au_d_hashed_positive(d); ++ if (err ++ && inode ++ && (inode->i_state & I_LINKABLE)) ++ err = 0; ++ return err; ++} ++ +static inline int au_d_alive(struct dentry *d) +{ + int err; @@ -5441,11 +5488,17 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + return err; +} + ++static inline int au_qstreq(struct qstr *a, struct qstr *b) ++{ ++ return a->len == b->len ++ && !memcmp(a->name, b->name, a->len); ++} ++ +#endif /* __KERNEL__ */ +#endif /* __AUFS_DCSUB_H__ */ --- a/fs/aufs/debug.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/debug.c 2014-01-20 03:24:33.508760970 +0000 -@@ -0,0 +1,517 @@ ++++ b/fs/aufs/debug.c 2014-06-17 18:23:40.783905015 +0100 +@@ -0,0 +1,518 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * @@ -5663,9 +5716,10 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + dinfo = au_di(dentry); + if (!dinfo) + return; -+ dpri("d-1: bstart %d, bend %d, bwh %d, bdiropq %d, gen %d\n", ++ dpri("d-1: bstart %d, bend %d, bwh %d, bdiropq %d, gen %d, tmp %d\n", + dinfo->di_bstart, dinfo->di_bend, -+ dinfo->di_bwh, dinfo->di_bdiropq, au_digen(dentry)); ++ dinfo->di_bwh, dinfo->di_bdiropq, au_digen(dentry), ++ dinfo->di_tmpfile); + if (dinfo->di_bstart < 0) + return; + hdp = dinfo->di_hdentry; @@ -6214,8 +6268,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch +#endif /* __KERNEL__ */ +#endif /* __AUFS_DEBUG_H__ */ --- a/fs/aufs/dentry.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/dentry.c 2014-03-13 00:59:36.876223577 +0000 -@@ -0,0 +1,1081 @@ ++++ b/fs/aufs/dentry.c 2014-06-17 18:23:40.783905015 +0100 +@@ -0,0 +1,1085 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * @@ -6927,7 +6981,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + if (!ebrange) + ebrange = au_do_refresh_hdentry(dentry, parent); + -+ if (d_unhashed(dentry) || ebrange) { ++ if (d_unhashed(dentry) || ebrange /* || dinfo->di_tmpfile */) { + AuDebugOn(au_dbstart(dentry) < 0 && au_dbend(dentry) >= 0); + if (inode) + err = au_refresh_hinode_self(inode); @@ -7013,7 +7067,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + int err; + umode_t mode, h_mode; + aufs_bindex_t bindex, btail, bstart, ibs, ibe; -+ unsigned char plus, unhashed, is_root, h_plus, h_nfs; ++ unsigned char plus, unhashed, is_root, h_plus, h_nfs, tmpfile; + struct inode *h_inode, *h_cached_inode; + struct dentry *h_dentry; + struct qstr *name, *h_name; @@ -7026,6 +7080,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + unhashed = !!d_unhashed(dentry); + is_root = !!IS_ROOT(dentry); + name = &dentry->d_name; ++ tmpfile = au_di(dentry)->di_tmpfile; + + /* + * Theoretically, REVAL test should be unnecessary in case of @@ -7059,18 +7114,20 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + && !is_root + && ((!h_nfs + && (unhashed != !!d_unhashed(h_dentry) -+ || name->len != h_name->len -+ || memcmp(name->name, h_name->name, -+ name->len))) ++ || (!tmpfile ++ && !au_qstreq(name, h_name)) ++ )) + || (h_nfs + && !(flags & LOOKUP_OPEN) + && (h_dentry->d_flags + & DCACHE_NFSFS_RENAMED))) + )) { -+ AuDbg("unhash 0x%x 0x%x, %pd %pd\n", -+ unhashed, d_unhashed(h_dentry), -+ dentry, h_dentry); ++ int h_unhashed; ++ ++ h_unhashed = d_unhashed(h_dentry); + spin_unlock(&h_dentry->d_lock); ++ AuDbg("unhash 0x%x 0x%x, %pd %pd\n", ++ unhashed, h_unhashed, dentry, h_dentry); + goto err; + } + spin_unlock(&h_dentry->d_lock); @@ -7100,7 +7157,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + h_cached_inode = au_h_iptr(inode, bindex); + + if (!h_nfs) { -+ if (unlikely(plus != h_plus)) ++ if (unlikely(plus != h_plus && !tmpfile)) + goto err; + } else { + if (unlikely(!(h_dentry->d_flags & DCACHE_NFSFS_RENAMED) @@ -7247,6 +7304,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + err = -EINVAL; + if (!(flags & LOOKUP_OPEN) + && inode ++ && !(inode->i_state && I_LINKABLE) + && (IS_DEADDIR(inode) || !inode->i_nlink)) + goto out_inval; + @@ -7298,8 +7356,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + .d_release = aufs_d_release +}; --- a/fs/aufs/dentry.h 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/dentry.h 2014-01-20 03:24:33.508760970 +0000 -@@ -0,0 +1,233 @@ ++++ b/fs/aufs/dentry.h 2014-06-17 18:23:40.783905015 +0100 +@@ -0,0 +1,234 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * @@ -7339,6 +7397,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + + struct au_rwsem di_rwsem; + aufs_bindex_t di_bstart, di_bend, di_bwh, di_bdiropq; ++ unsigned char di_tmpfile; /* to allow the different name */ + struct au_hdentry *di_hdentry; +} ____cacheline_aligned_in_smp; + @@ -7534,8 +7593,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch +#endif /* __KERNEL__ */ +#endif /* __AUFS_DENTRY_H__ */ --- a/fs/aufs/dinfo.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/dinfo.c 2014-01-20 03:24:33.512760970 +0000 -@@ -0,0 +1,542 @@ ++++ b/fs/aufs/dinfo.c 2014-06-17 18:23:40.783905015 +0100 +@@ -0,0 +1,544 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * @@ -7587,6 +7646,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + dinfo->di_bend = -1; + dinfo->di_bwh = -1; + dinfo->di_bdiropq = -1; ++ dinfo->di_tmpfile = 0; + for (i = 0; i < nbr; i++) + dinfo->di_hdentry[i].hd_id = -1; + goto out; @@ -7861,7 +7921,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + +/* + * extended version of au_h_dptr(). -+ * returns a hashed and positive h_dentry in bindex, NULL, or error. ++ * returns a hashed and positive (or linkable) h_dentry in bindex, NULL, or ++ * error. + */ +struct dentry *au_h_d_alias(struct dentry *dentry, aufs_bindex_t bindex) +{ @@ -7875,7 +7936,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + if (au_dbstart(dentry) <= bindex + && bindex <= au_dbend(dentry)) + h_dentry = au_h_dptr(dentry, bindex); -+ if (h_dentry && !au_d_hashed_positive(h_dentry)) { ++ if (h_dentry && !au_d_linkable(h_dentry)) { + dget(h_dentry); + goto out; /* success */ + } @@ -7886,7 +7947,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + h_dentry = d_find_alias(h_inode); + if (h_dentry) { + if (!IS_ERR(h_dentry)) { -+ if (!au_d_hashed_positive(h_dentry)) ++ if (!au_d_linkable(h_dentry)) + goto out; /* success */ + dput(h_dentry); + } else @@ -10154,8 +10215,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + 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 2014-05-13 19:05:05.252347320 +0100 -@@ -0,0 +1,725 @@ ++++ b/fs/aufs/f_op.c 2014-06-17 18:23:40.783905015 +0100 +@@ -0,0 +1,733 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * @@ -10190,6 +10251,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + struct file *h_file; + struct dentry *dentry; + struct au_finfo *finfo; ++ struct inode *h_inode; + + FiMustWriteLock(file); + @@ -10203,6 +10265,13 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + if (IS_ERR(h_file)) + err = PTR_ERR(h_file); + else { ++ if ((flags & __O_TMPFILE) ++ && !(flags & O_EXCL)) { ++ h_inode = file_inode(h_file); ++ spin_lock(&h_inode->i_lock); ++ h_inode->i_state |= I_LINKABLE; ++ spin_unlock(&h_inode->i_lock); ++ } + au_set_fbstart(file, bindex); + au_set_h_fptr(file, bindex, h_file); + au_update_figen(file); @@ -10882,8 +10951,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch +#endif +}; --- a/fs/aufs/f_op_sp.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/f_op_sp.c 2014-01-20 03:24:33.512760970 +0000 -@@ -0,0 +1,382 @@ ++++ b/fs/aufs/f_op_sp.c 2014-06-17 18:23:40.787905015 +0100 +@@ -0,0 +1,386 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * @@ -11177,7 +11246,9 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + struct super_block *sb; + struct file *h_file; + struct inode *h_inode; ++ struct au_finfo *finfo; + ++ finfo = au_fi(file); + err = au_fi_sp_add(file); + if (unlikely(err)) + goto out; @@ -11210,10 +11281,12 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + if (!err) { + au_init_fop_sp(file); + goto out; /* success */ -+ } ++ } else ++ au_set_h_fptr(file, au_fbstart(file), NULL); + +out_del: + au_fi_sp_del(file); ++ file->private_data = finfo; +out: + return err; +} @@ -11267,8 +11340,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + return ret; +} --- a/fs/aufs/file.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/file.c 2014-05-13 19:05:02.880347266 +0100 -@@ -0,0 +1,724 @@ ++++ b/fs/aufs/file.c 2014-06-17 18:23:40.787905015 +0100 +@@ -0,0 +1,725 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * @@ -11530,7 +11603,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + err = au_reopen_wh(file, bcpup, hi_wh); + + if (!err -+ && inode->i_nlink > 1 ++ && (inode->i_nlink > 1 ++ || (inode->i_state & I_LINKABLE)) + && au_opt_test(au_mntflags(cpg.dentry->d_sb), PLINK)) + au_plink_append(inode, bcpup, au_h_dptr(cpg.dentry, bcpup)); + @@ -13283,8 +13357,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + } +} --- a/fs/aufs/hnotify.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/hnotify.c 2014-05-13 19:05:02.880347266 +0100 -@@ -0,0 +1,710 @@ ++++ b/fs/aufs/hnotify.c 2014-06-17 18:23:40.787905015 +0100 +@@ -0,0 +1,711 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * @@ -13613,7 +13687,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + && a->inode + && a->h_inode) { + mutex_lock_nested(&a->h_inode->i_mutex, AuLsc_I_CHILD); -+ if (!a->h_inode->i_nlink) ++ if (!a->h_inode->i_nlink ++ && !(a->h_inode->i_state & I_LINKABLE)) + hn_xino(a->inode, a->h_inode); /* ignore this error */ + mutex_unlock(&a->h_inode->i_mutex); + } @@ -13996,8 +14071,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + au_hn_destroy_cache(); +} --- a/fs/aufs/i_op.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/i_op.c 2014-03-13 00:59:36.876223577 +0000 -@@ -0,0 +1,1127 @@ ++++ b/fs/aufs/i_op.c 2014-06-17 18:23:40.787905015 +0100 +@@ -0,0 +1,1132 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * @@ -14266,7 +14341,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + else + BUG(); + } -+ if (!err && add_entry) { ++ if (!err && add_entry && !au_ftest_wrdir(add_entry, TMPFILE)) { + h_parent = au_h_dptr(parent, bcpup); + h_dir = h_parent->d_inode; + mutex_lock_nested(&h_dir->i_mutex, AuLsc_I_PARENT); @@ -14305,7 +14380,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + aufs_bindex_t bcpup, bstart, src_bstart; + const unsigned char add_entry + = au_ftest_wrdir(args->flags, ADD_ENTRY) -+ | au_ftest_wrdir(args->flags, TMP_WHENTRY); ++ | au_ftest_wrdir(args->flags, TMP_WHENTRY) ++ | au_ftest_wrdir(args->flags, TMPFILE); + struct super_block *sb; + struct dentry *parent; + struct au_sbinfo *sbinfo; @@ -14361,7 +14437,9 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + au_set_dbstart(dentry, bcpup); + au_set_dbend(dentry, bcpup); + } -+ AuDebugOn(add_entry && !au_h_dptr(dentry, bcpup)); ++ AuDebugOn(add_entry ++ && !au_ftest_wrdir(args->flags, TMPFILE) ++ && !au_h_dptr(dentry, bcpup)); + } + +out: @@ -15114,8 +15192,10 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + .setattr = aufs_setattr, + .getattr = aufs_getattr, + -+ .update_time = aufs_update_time ++ .update_time = aufs_update_time, + /* no support for atomic_open() */ ++ ++ .tmpfile = aufs_tmpfile +}; + +struct inode_operations aufs_iop = { @@ -15126,8 +15206,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + .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 2014-01-20 03:24:33.512760970 +0000 -@@ -0,0 +1,762 @@ ++++ b/fs/aufs/i_op_add.c 2014-06-17 18:23:40.787905015 +0100 +@@ -0,0 +1,881 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * @@ -15486,6 +15566,121 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + return add_simple(dir, dentry, &arg); +} + ++int aufs_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode) ++{ ++ int err; ++ aufs_bindex_t bindex; ++ struct super_block *sb; ++ struct dentry *parent, *h_parent, *h_dentry; ++ struct inode *h_dir, *inode; ++ struct vfsmount *h_mnt; ++ struct au_wr_dir_args wr_dir_args = { ++ .force_btgt = -1, ++ .flags = AuWrDir_TMPFILE ++ }; ++ ++ /* copy-up may happen */ ++ mutex_lock(&dir->i_mutex); ++ ++ sb = dir->i_sb; ++ err = si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLM); ++ if (unlikely(err)) ++ goto out; ++ ++ err = au_di_init(dentry); ++ if (unlikely(err)) ++ goto out_si; ++ ++ err = -EBUSY; ++ parent = d_find_any_alias(dir); ++ AuDebugOn(!parent); ++ di_write_lock_parent(parent); ++ if (unlikely(parent->d_inode != dir)) ++ goto out_parent; ++ ++ err = au_digen_test(parent, au_sigen(sb)); ++ if (unlikely(err)) ++ goto out_parent; ++ ++ bindex = au_dbstart(parent); ++ au_set_dbstart(dentry, bindex); ++ au_set_dbend(dentry, bindex); ++ err = au_wr_dir(dentry, /*src_dentry*/NULL, &wr_dir_args); ++ bindex = err; ++ if (unlikely(err < 0)) ++ goto out_parent; ++ ++ err = -EOPNOTSUPP; ++ h_dir = au_h_iptr(dir, bindex); ++ if (unlikely(!h_dir->i_op->tmpfile)) ++ goto out_parent; ++ ++ h_mnt = au_sbr_mnt(sb, bindex); ++ err = vfsub_mnt_want_write(h_mnt); ++ if (unlikely(err)) ++ goto out_parent; ++ ++ h_parent = au_h_dptr(parent, bindex); ++ err = inode_permission(h_parent->d_inode, MAY_WRITE | MAY_EXEC); ++ if (unlikely(err)) ++ goto out_mnt; ++ ++ err = -ENOMEM; ++ h_dentry = d_alloc(h_parent, &dentry->d_name); ++ if (unlikely(!h_dentry)) ++ goto out_mnt; ++ ++ err = h_dir->i_op->tmpfile(h_dir, h_dentry, mode); ++ if (unlikely(err)) ++ goto out_dentry; ++ ++ au_set_dbstart(dentry, bindex); ++ au_set_dbend(dentry, bindex); ++ au_set_h_dptr(dentry, bindex, dget(h_dentry)); ++ inode = au_new_inode(dentry, /*must_new*/1); ++ if (IS_ERR(inode)) { ++ err = PTR_ERR(inode); ++ au_set_h_dptr(dentry, bindex, NULL); ++ au_set_dbstart(dentry, -1); ++ au_set_dbend(dentry, -1); ++ } else { ++ if (!inode->i_nlink) ++ set_nlink(inode, 1); ++ d_tmpfile(dentry, inode); ++ au_di(dentry)->di_tmpfile = 1; ++ ++ /* update without i_mutex */ ++ if (au_ibstart(dir) == au_dbstart(dentry)) ++ au_cpup_attr_timesizes(dir); ++ } ++ ++out_dentry: ++ dput(h_dentry); ++out_mnt: ++ vfsub_mnt_drop_write(h_mnt); ++out_parent: ++ di_write_unlock(parent); ++ dput(parent); ++ di_write_unlock(dentry); ++ if (!err) ++#if 0 ++ /* verbose coding for lock class name */ ++ au_rw_class(&au_di(dentry)->di_rwsem, ++ au_lc_key + AuLcNonDir_DIINFO); ++#else ++ ; ++#endif ++ else { ++ au_di_fin(dentry); ++ dentry->d_fsdata = NULL; ++ } ++out_si: ++ si_read_unlock(sb); ++out: ++ mutex_unlock(&dir->i_mutex); ++ return err; ++} ++ +/* ---------------------------------------------------------------------- */ + +struct au_link_args { @@ -15649,7 +15844,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + AuLock_NOPLM | AuLock_GEN); + if (unlikely(err)) + goto out_kfree; -+ err = au_d_hashed_positive(src_dentry); ++ err = au_d_linkable(src_dentry); + if (unlikely(err)) + goto out_unlock; + err = au_d_may_add(dentry); @@ -15674,12 +15869,16 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + a->h_path.mnt = au_sbr_mnt(sb, a->bdst); + a->bsrc = au_ibstart(inode); + h_src_dentry = au_h_d_alias(src_dentry, a->bsrc); ++ if (!h_src_dentry && au_di(src_dentry)->di_tmpfile) ++ h_src_dentry = dget(au_hi_wh(inode, a->bsrc)); + if (!h_src_dentry) { + a->bsrc = au_dbstart(src_dentry); + h_src_dentry = au_h_d_alias(src_dentry, a->bsrc); + AuDebugOn(!h_src_dentry); -+ } else if (IS_ERR(h_src_dentry)) ++ } else if (IS_ERR(h_src_dentry)) { ++ err = PTR_ERR(h_src_dentry); + goto out_parent; ++ } + + if (au_opt_test(au_mntflags(sb), PLINK)) { + if (a->bdst < a->bsrc @@ -17435,8 +17634,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + return err; +} --- a/fs/aufs/iinfo.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/iinfo.c 2014-01-20 03:24:33.512760970 +0000 -@@ -0,0 +1,275 @@ ++++ b/fs/aufs/iinfo.c 2014-06-17 18:23:40.787905015 +0100 +@@ -0,0 +1,277 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * @@ -17584,7 +17783,9 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + struct inode *h_i; + + h_i = iinfo->ii_hinode[0 + bindex].hi_inode; -+ if (h_i && !h_i->i_nlink) ++ if (h_i ++ && !h_i->i_nlink ++ && !(h_i->i_state & I_LINKABLE)) + au_set_h_iptr(inode, bindex, NULL, 0); + } + } @@ -18207,8 +18408,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + 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 2014-01-20 03:24:33.516760970 +0000 -@@ -0,0 +1,599 @@ ++++ b/fs/aufs/inode.h 2014-06-17 18:23:40.787905015 +0100 +@@ -0,0 +1,601 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * @@ -18367,6 +18568,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch +#define AuWrDir_ADD_ENTRY 1 +#define AuWrDir_TMP_WHENTRY (1 << 1) +#define AuWrDir_ISDIR (1 << 2) ++#define AuWrDir_TMPFILE (1 << 3) +#define au_ftest_wrdir(flags, name) ((flags) & AuWrDir_##name) +#define au_fset_wrdir(flags, name) \ + do { (flags) |= AuWrDir_##name; } while (0) @@ -18397,6 +18599,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch +int aufs_symlink(struct inode *dir, struct dentry *dentry, const char *symname); +int aufs_create(struct inode *dir, struct dentry *dentry, umode_t mode, + bool want_excl); ++int aufs_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode); +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); @@ -30365,8 +30568,8 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch +#endif /* __KERNEL__ */ +#endif /* __AUFS_WKQ_H__ */ --- a/fs/aufs/xino.c 1970-01-01 01:00:00.000000000 +0100 -+++ b/fs/aufs/xino.c 2014-01-20 03:24:33.520760970 +0000 -@@ -0,0 +1,1314 @@ ++++ b/fs/aufs/xino.c 2014-06-17 18:23:40.791905016 +0100 +@@ -0,0 +1,1312 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima + * @@ -31569,9 +31772,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + cur_parent = dget_parent(cur_xino->f_dentry); + cur_name = &cur_xino->f_dentry->d_name; + skip = (cur_parent == parent -+ && dname->len == cur_name->len -+ && !memcmp(dname->name, cur_name->name, -+ dname->len)); ++ && au_qstreq(dname, cur_name)); + dput(cur_parent); + } + if (skip) @@ -31682,7 +31883,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + return err; +} --- a/include/uapi/linux/aufs_type.h 1970-01-01 01:00:00.000000000 +0100 -+++ b/include/uapi/linux/aufs_type.h 2014-05-13 19:05:05.252347320 +0100 ++++ b/include/uapi/linux/aufs_type.h 2014-06-17 18:23:40.791905016 +0100 @@ -0,0 +1,281 @@ +/* + * Copyright (C) 2005-2014 Junjiro R. Okajima @@ -31725,7 +31926,7 @@ Patch generated by debian/patches/features/all/aufs3/gen-patch + +#include + -+#define AUFS_VERSION "3.14-20140512" ++#define AUFS_VERSION "3.14-20140616" + +/* 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 23755b7b6..c379c610d 100644 --- a/debian/patches/features/all/aufs3/aufs3-base.patch +++ b/debian/patches/features/all/aufs3/aufs3-base.patch @@ -1,7 +1,7 @@ From: J. R. Okajima Date: Tue Apr 1 11:01:55 2014 +0900 Subject: aufs3.14 base patch -Origin: http://sourceforge.net/p/aufs/aufs3-standalone/ci/16de14a1266dc814561c755485f0b79efc6b25b5/tree/ +Origin: http://sourceforge.net/p/aufs/aufs3-standalone/ci/d201c504500b2091b88aa648e5163589e29b6822/tree/ Bug-Debian: https://bugs.debian.org/541828 Patch headers added by debian/patches/features/all/aufs3/gen-patch diff --git a/debian/patches/features/all/aufs3/aufs3-kbuild.patch b/debian/patches/features/all/aufs3/aufs3-kbuild.patch index a11f91f26..f373d159a 100644 --- a/debian/patches/features/all/aufs3/aufs3-kbuild.patch +++ b/debian/patches/features/all/aufs3/aufs3-kbuild.patch @@ -1,7 +1,7 @@ From: J. R. Okajima Date: Tue Apr 1 11:01:55 2014 +0900 Subject: aufs3.14 kbuild patch -Origin: http://sourceforge.net/p/aufs/aufs3-standalone/ci/16de14a1266dc814561c755485f0b79efc6b25b5/tree/ +Origin: http://sourceforge.net/p/aufs/aufs3-standalone/ci/d201c504500b2091b88aa648e5163589e29b6822/tree/ Bug-Debian: https://bugs.debian.org/541828 Patch headers added by debian/patches/features/all/aufs3/gen-patch diff --git a/debian/patches/features/all/aufs3/aufs3-mmap.patch b/debian/patches/features/all/aufs3/aufs3-mmap.patch index 8a7c02261..8829d895a 100644 --- a/debian/patches/features/all/aufs3/aufs3-mmap.patch +++ b/debian/patches/features/all/aufs3/aufs3-mmap.patch @@ -1,7 +1,7 @@ From: J. R. Okajima -Date: Tue Apr 1 11:01:55 2014 +0900 +Date: Sun Jun 15 16:10:12 2014 +0900 Subject: aufs3.14 mmap patch -Origin: http://sourceforge.net/p/aufs/aufs3-standalone/ci/16de14a1266dc814561c755485f0b79efc6b25b5/tree/ +Origin: http://sourceforge.net/p/aufs/aufs3-standalone/ci/d201c504500b2091b88aa648e5163589e29b6822/tree/ Bug-Debian: https://bugs.debian.org/541828 Patch headers added by debian/patches/features/all/aufs3/gen-patch @@ -223,19 +223,39 @@ index 7a13f6a..f1805df 100644 if (page->mapping != inode->i_mapping) { unlock_page(page); diff --git a/mm/fremap.c b/mm/fremap.c -index 34feba6..d857364 100644 +index 34feba6..8d6c451 100644 --- a/mm/fremap.c +++ b/mm/fremap.c -@@ -227,7 +227,9 @@ get_write_lock: +@@ -223,16 +223,27 @@ get_write_lock: + */ + if (mapping_cap_account_dirty(mapping)) { + unsigned long addr; +- struct file *file = get_file(vma->vm_file); ++ struct file *file = vma->vm_file, ++ *prfile = vma->vm_prfile; ++ /* mmap_region may free vma; grab the info now */ vm_flags = vma->vm_flags; + vma_get_file(vma); addr = mmap_region(file, start, size, vm_flags, pgoff); +- fput(file); + vma_fput(vma); - fput(file); if (IS_ERR_VALUE(addr)) { err = addr; + } else { + BUG_ON(addr != start); ++ if (prfile) { ++ struct vm_area_struct *new_vma; ++ new_vma = find_vma(mm, addr); ++ if (!new_vma->vm_prfile) ++ new_vma->vm_prfile = prfile; ++ if (new_vma != vma) ++ get_file(prfile); ++ } + err = 0; + } + goto out_freed; diff --git a/mm/madvise.c b/mm/madvise.c index 539eeb9..5e700b1 100644 --- a/mm/madvise.c diff --git a/debian/patches/features/all/aufs3/aufs3-standalone.patch b/debian/patches/features/all/aufs3/aufs3-standalone.patch index 82474c4a6..bdda41487 100644 --- a/debian/patches/features/all/aufs3/aufs3-standalone.patch +++ b/debian/patches/features/all/aufs3/aufs3-standalone.patch @@ -1,7 +1,7 @@ From: J. R. Okajima Date: Tue Apr 1 11:01:55 2014 +0900 Subject: aufs3.14 standalone patch -Origin: http://sourceforge.net/p/aufs/aufs3-standalone/ci/16de14a1266dc814561c755485f0b79efc6b25b5/tree/ +Origin: http://sourceforge.net/p/aufs/aufs3-standalone/ci/d201c504500b2091b88aa648e5163589e29b6822/tree/ Bug-Debian: https://bugs.debian.org/541828 Patch headers added by debian/patches/features/all/aufs3/gen-patch