packages: kernel/kernel-aufs2.patch - unofficial update, see http://www.mai...

baggins baggins at pld-linux.org
Tue Oct 26 13:02:51 CEST 2010


Author: baggins                      Date: Tue Oct 26 11:02:51 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- unofficial update, see http://www.mail-archive.com/aufs-users@lists.sourceforge.net/msg02921.html

---- Files affected:
packages/kernel:
   kernel-aufs2.patch (1.10 -> 1.11) 

---- Diffs:

================================================================
Index: packages/kernel/kernel-aufs2.patch
diff -u packages/kernel/kernel-aufs2.patch:1.10 packages/kernel/kernel-aufs2.patch:1.11
--- packages/kernel/kernel-aufs2.patch:1.10	Thu Oct 21 09:58:51 2010
+++ packages/kernel/kernel-aufs2.patch	Tue Oct 26 13:02:43 2010
@@ -1,4 +1,4 @@
-aufs2 kbuild patch for linux-2.6.
+aufs2.1 kbuild patch for linux-2.6.36
 
 diff --git a/fs/Kconfig b/fs/Kconfig
 index 3d18530..8f582e1 100644
@@ -33,13 +33,13 @@
  header-y += auto_fs.h
  header-y += auto_fs4.h
  header-y += auxvec.h
-aufs2 base patch for linux-2.6.
+aufs2.1 base patch for linux-2.6.35
 
 diff --git a/fs/namei.c b/fs/namei.c
-index 17ea76b..56e8ece 100644
+index 868d0cb..6e92c81 100644
 --- a/fs/namei.c
 +++ b/fs/namei.c
-@@ -1168,7 +1168,7 @@ out:
+@@ -1178,7 +1178,7 @@ out:
   * needs parent already locked. Doesn't follow mounts.
   * SMP-safe.
   */
@@ -48,7 +48,7 @@
  {
  	int err;
  
-@@ -1178,7 +1178,7 @@ static struct dentry *lookup_hash(struct nameidata *nd)
+@@ -1188,7 +1188,7 @@ static struct dentry *lookup_hash(struct nameidata *nd)
  	return __lookup_hash(&nd->last, nd->path.dentry, nd);
  }
  
@@ -58,10 +58,10 @@
  {
  	unsigned long hash;
 diff --git a/fs/splice.c b/fs/splice.c
-index 8f1dfae..278c94f 100644
+index efdbfec..e01a51e 100644
 --- a/fs/splice.c
 +++ b/fs/splice.c
-@@ -1092,8 +1092,8 @@ EXPORT_SYMBOL(generic_splice_sendpage);
+@@ -1104,8 +1104,8 @@ EXPORT_SYMBOL(generic_splice_sendpage);
  /*
   * Attempt to initiate a splice from pipe to file.
   */
@@ -72,7 +72,7 @@
  {
  	ssize_t (*splice_write)(struct pipe_inode_info *, struct file *,
  				loff_t *, size_t, unsigned int);
-@@ -1120,9 +1120,9 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
+@@ -1132,9 +1132,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.
   */
@@ -114,8 +114,20 @@
 +			 unsigned int flags);
 +
  #endif
-aufs2 standalone patch for linux-2.6.
+aufs2.1 standalone patch for linux-2.6.36
 
+diff --git a/fs/inode.c b/fs/inode.c
+index 722860b..bfb0698 100644
+--- a/fs/inode.c
++++ b/fs/inode.c
+@@ -84,6 +84,7 @@ static struct hlist_head *inode_hashtable __read_mostly;
+  * the i_state of an inode while it is in use..
+  */
+ DEFINE_SPINLOCK(inode_lock);
++EXPORT_SYMBOL(inode_lock);
+ 
+ /*
+  * iprune_sem provides exclusion between the kswapd or try_to_free_pages
 diff --git a/fs/namei.c b/fs/namei.c
 index 56e8ece..ba75f28 100644
 --- a/fs/namei.c
@@ -378,9 +390,8 @@
  
  int security_file_mprotect(struct vm_area_struct *vma, unsigned long reqprot,
  			    unsigned long prot)
-diff -urN /usr/share/empty/Documentation/ABI/testing/debugfs-aufs linux/Documentation/ABI/testing/debugfs-aufs
---- /usr/share/empty/Documentation/ABI/testing/debugfs-aufs	1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/ABI/testing/debugfs-aufs	2010-10-21 09:52:43.080290296 +0200
+--- /dev/null
++++ linux-2.6/Documentation/ABI/testing/debugfs-aufs	2010-10-24 11:11:14.000000000 +0200
 @@ -0,0 +1,37 @@
 +What:		/debug/aufs/si_<id>/
 +Date:		March 2009
@@ -419,9 +430,8 @@
 +		be created.
 +		When the aufs mount option 'noxino' is specified, it
 +		will be empty. About XINO files, see the aufs manual.
-diff -urN /usr/share/empty/Documentation/ABI/testing/sysfs-aufs linux/Documentation/ABI/testing/sysfs-aufs
---- /usr/share/empty/Documentation/ABI/testing/sysfs-aufs	1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/ABI/testing/sysfs-aufs	2010-10-21 09:52:43.080290296 +0200
+--- /dev/null
++++ linux-2.6/Documentation/ABI/testing/sysfs-aufs	2010-10-24 11:11:14.000000000 +0200
 @@ -0,0 +1,24 @@
 +What:		/sys/fs/aufs/si_<id>/
 +Date:		March 2009
@@ -447,9 +457,8 @@
 +		even if it is the default path.
 +		When the aufs mount option 'noxino' is specified, it
 +		will be empty. About XINO files, see the aufs manual.
-diff -urN /usr/share/empty/fs/aufs/aufs.h linux/fs/aufs/aufs.h
---- /usr/share/empty/fs/aufs/aufs.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/aufs.h	2010-10-21 09:52:43.083624114 +0200
+--- /dev/null
++++ linux-2.6/fs/aufs/aufs.h	2010-10-24 11:19:23.000000000 +0200
 @@ -0,0 +1,61 @@
 +/*
 + * Copyright (C) 2005-2010 Junjiro R. Okajima
@@ -512,10 +521,9 @@
 +
 +#endif /* __KERNEL__ */
 +#endif /* __AUFS_H__ */
-diff -urN /usr/share/empty/fs/aufs/branch.c linux/fs/aufs/branch.c
---- /usr/share/empty/fs/aufs/branch.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/branch.c	2010-10-21 09:52:43.086957936 +0200
-@@ -0,0 +1,1005 @@
+--- /dev/null
++++ linux-2.6/fs/aufs/branch.c	2010-10-24 16:28:53.000000000 +0200
+@@ -0,0 +1,1020 @@
 +/*
 + * Copyright (C) 2005-2010 Junjiro R. Okajima
 + *
@@ -839,11 +847,11 @@
 +	 * a limit for rmdir/rename a dir
 +	 * cf. AUFS_MAX_NAMELEN in include/linux/aufs_type.h
 +	 */
++	h_dentry = path->dentry;
 +	err = vfs_statfs(path, &kst);
 +	if (unlikely(err))
 +		goto out;
 +	err = -EINVAL;
-+	h_dentry = path->dentry;
 +	if (kst.f_namelen >= NAME_MAX)
 +		err = au_br_init_wh(sb, br, perm, h_dentry);
 +	else
@@ -954,7 +962,6 @@
 +
 +	root = sb->s_root;
 +	root_inode = root->d_inode;
-+	au_plink_maint_block(sb);
 +	bend = au_sbend(sb);
 +	amount = bend + 1 - bindex;
 +	au_br_do_add_brp(au_sbi(sb), bindex, br, bend, amount);
@@ -1232,7 +1239,6 @@
 +
 +	root = sb->s_root;
 +	inode = root->d_inode;
-+	au_plink_maint_block(sb);
 +	sbinfo = au_sbi(sb);
 +	bend = sbinfo->si_bend;
 +
@@ -1277,8 +1283,7 @@
 +	i = atomic_read(&br->br_count);
 +	if (unlikely(i)) {
 +		AuVerbose(verbose, "%d file(s) opened\n", i);
-+		if (!verbose)
-+			goto out;
++		goto out;
 +	}
 +
 +	wbr = br->br_wbr;
@@ -1341,7 +1346,7 @@
 +{
 +#ifdef CONFIG_IMA
 +	/* since it doesn't support mark_files_ro() */
-+	pr_warning("RW -> RO makes IMA to produce wrong message");
++	AuWarn1("RW -> RO makes IMA to produce wrong message");
 +#endif
 +}
 +
@@ -1360,8 +1365,15 @@
 +{
 +	int err;
 +	unsigned long n, ul, bytes, files;
-+	aufs_bindex_t bstart;
++	aufs_bindex_t br_id;
 +	struct file *file, *hf, **a;
++	struct dentry *dentry;
++	struct inode *inode;
++	struct au_hfile *hfile;
++	struct list_head *list;
++#ifdef CONFIG_SMP
++	int cpu;
++#endif
 +	const int step_bytes = 1024, /* memory allocation unit */
 +		step_files = step_bytes / sizeof(*a);
 +
@@ -1373,10 +1385,21 @@
 +	if (unlikely(!a))
 +		goto out;
 +
++#ifdef CONFIG_SMP
++	cpu = smp_processor_id();
++	file->f_sb_list_cpu = cpu;
++	list = per_cpu_ptr(sb->s_files, cpu);
++#else
++	list = &sb->s_files;
++#endif
++
 +	/* no need file_list_lock() since sbinfo is locked? defered? */
-+	list_for_each_entry(file, &sb->s_files, f_u.fu_list) {
++	br_id = au_sbr_id(sb, bindex);
++	list_for_each_entry(file, list, f_u.fu_list) {
 +		if (special_file(file->f_dentry->d_inode->i_mode))
 +			continue;
++		dentry = file->f_dentry;
++		inode = dentry->d_inode;
 +
 +		AuDbg("%.*s\n", AuDLNPair(file->f_dentry));
 +		fi_read_lock(file);
@@ -1387,16 +1410,17 @@
 +			goto out_free;
 +		}
 +
-+		bstart = au_fbstart(file);
-+		if (!S_ISREG(file->f_dentry->d_inode->i_mode)
++		hfile = &au_fi(file)->fi_htop;
++		hf = hfile->hf_file;
++		if (!S_ISREG(inode->i_mode)
 +		    || !(file->f_mode & FMODE_WRITE)
-+		    || bstart != bindex) {
++		    || hfile->hf_br->br_id != br_id
++		    || !(hf->f_mode & FMODE_WRITE)) {
 +			FiMustNoWaiters(file);
 +			fi_read_unlock(file);
 +			continue;
 +		}
 +
-+		hf = au_hf_top(file);
 +		FiMustNoWaiters(file);
 +		fi_read_unlock(file);
 +
@@ -1447,7 +1471,6 @@
 +	struct au_branch *br;
 +
 +	root = sb->s_root;
-+	au_plink_maint_block(sb);
 +	bindex = au_find_dbindex(root, mod->h_root);
 +	if (bindex < 0) {
 +		if (remount)
@@ -1521,9 +1544,8 @@
 +out:
 +	return err;
 +}
-diff -urN /usr/share/empty/fs/aufs/branch.h linux/fs/aufs/branch.h
---- /usr/share/empty/fs/aufs/branch.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/branch.h	2010-10-21 09:52:43.086957936 +0200
+--- /dev/null
++++ linux-2.6/fs/aufs/branch.h	2010-10-24 11:30:39.000000000 +0200
 @@ -0,0 +1,224 @@
 +/*
 + * Copyright (C) 2005-2010 Junjiro R. Okajima
@@ -1722,7 +1744,7 @@
 +
 +static inline void au_sbr_put(struct super_block *sb, aufs_bindex_t bindex)
 +{
-+	atomic_dec_return(&au_sbr(sb, bindex)->br_count);
++	atomic_dec(&au_sbr(sb, bindex)->br_count);
 +}
 +
 +static inline int au_sbr_perm(struct super_block *sb, aufs_bindex_t bindex)
@@ -1749,10 +1771,9 @@
 +
 +#endif /* __KERNEL__ */
 +#endif /* __AUFS_BRANCH_H__ */
-diff -urN /usr/share/empty/fs/aufs/conf.mk linux/fs/aufs/conf.mk
---- /usr/share/empty/fs/aufs/conf.mk	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/conf.mk	2010-10-21 09:52:43.086957936 +0200
-@@ -0,0 +1,36 @@
+--- /dev/null
++++ linux-2.6/fs/aufs/conf.mk	2010-10-24 11:31:04.000000000 +0200
+@@ -0,0 +1,37 @@
 +
 +AuConfStr = CONFIG_AUFS_FS=${CONFIG_AUFS_FS}
 +
@@ -1763,7 +1784,8 @@
 +endef
 +
 +AuConfAll = BRANCH_MAX_127 BRANCH_MAX_511 BRANCH_MAX_1023 BRANCH_MAX_32767 \
-+	HNOTIFY HFSNOTIFY \
++	SBILIST \
++	HNOTIFY HFSNOTIFY HINOTIFY \
 +	EXPORT INO_T_64 \
 +	RDU \
 +	SP_IATTR \
@@ -1789,9 +1811,8 @@
 +${obj}/sysfs.o: ${AuConfName}
 +
 +-include ${srctree}/${src}/conf_priv.mk
-diff -urN /usr/share/empty/fs/aufs/cpup.c linux/fs/aufs/cpup.c
---- /usr/share/empty/fs/aufs/cpup.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/cpup.c	2010-10-21 09:52:43.086957936 +0200
+--- /dev/null
++++ linux-2.6/fs/aufs/cpup.c	2010-10-24 11:19:23.000000000 +0200
 @@ -0,0 +1,1059 @@
 +/*
 + * Copyright (C) 2005-2010 Junjiro R. Okajima
@@ -2852,9 +2873,8 @@
 +	dput(parent);
 +	return err;
 +}
-diff -urN /usr/share/empty/fs/aufs/cpup.h linux/fs/aufs/cpup.h
---- /usr/share/empty/fs/aufs/cpup.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/cpup.h	2010-10-21 09:52:43.086957936 +0200
+--- /dev/null
++++ linux-2.6/fs/aufs/cpup.h	2010-10-24 11:19:23.000000000 +0200
 @@ -0,0 +1,81 @@
 +/*
 + * Copyright (C) 2005-2010 Junjiro R. Okajima
@@ -2937,9 +2957,8 @@
 +
 +#endif /* __KERNEL__ */
 +#endif /* __AUFS_CPUP_H__ */
-diff -urN /usr/share/empty/fs/aufs/dbgaufs.c linux/fs/aufs/dbgaufs.c
---- /usr/share/empty/fs/aufs/dbgaufs.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dbgaufs.c	2010-10-21 09:52:43.086957936 +0200
+--- /dev/null
++++ linux-2.6/fs/aufs/dbgaufs.c	2010-10-24 11:19:23.000000000 +0200
 @@ -0,0 +1,334 @@
 +/*
 + * Copyright (C) 2005-2010 Junjiro R. Okajima
@@ -3275,9 +3294,8 @@
 +		err = 0;
 +	return err;
 +}
-diff -urN /usr/share/empty/fs/aufs/dbgaufs.h linux/fs/aufs/dbgaufs.h
---- /usr/share/empty/fs/aufs/dbgaufs.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dbgaufs.h	2010-10-21 09:52:43.086957936 +0200
+--- /dev/null
++++ linux-2.6/fs/aufs/dbgaufs.h	2010-10-24 11:19:23.000000000 +0200
 @@ -0,0 +1,52 @@
 +/*
 + * Copyright (C) 2005-2010 Junjiro R. Okajima
@@ -3331,9 +3349,8 @@
 +
 +#endif /* __KERNEL__ */
 +#endif /* __DBGAUFS_H__ */
-diff -urN /usr/share/empty/fs/aufs/dcsub.c linux/fs/aufs/dcsub.c
---- /usr/share/empty/fs/aufs/dcsub.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dcsub.c	2010-10-21 09:52:43.086957936 +0200
+--- /dev/null
++++ linux-2.6/fs/aufs/dcsub.c	2010-10-24 11:19:23.000000000 +0200
 @@ -0,0 +1,200 @@
 +/*
 + * Copyright (C) 2005-2010 Junjiro R. Okajima
@@ -3535,9 +3552,8 @@
 +
 +	return path_is_under(path + 0, path + 1);
 +}
-diff -urN /usr/share/empty/fs/aufs/dcsub.h linux/fs/aufs/dcsub.h
---- /usr/share/empty/fs/aufs/dcsub.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dcsub.h	2010-10-21 09:52:43.086957936 +0200
+--- /dev/null
++++ linux-2.6/fs/aufs/dcsub.h	2010-10-24 11:19:23.000000000 +0200
 @@ -0,0 +1,54 @@
 +/*
 + * Copyright (C) 2005-2010 Junjiro R. Okajima
@@ -3593,10 +3609,9 @@
 +
 +#endif /* __KERNEL__ */
 +#endif /* __AUFS_DCSUB_H__ */
-diff -urN /usr/share/empty/fs/aufs/debug.c linux/fs/aufs/debug.c
---- /usr/share/empty/fs/aufs/debug.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/debug.c	2010-10-21 09:52:43.086957936 +0200
-@@ -0,0 +1,426 @@
+--- /dev/null
++++ linux-2.6/fs/aufs/debug.c	2010-10-24 11:31:58.000000000 +0200
+@@ -0,0 +1,443 @@
 +/*
 + * Copyright (C) 2005-2010 Junjiro R. Okajima
 + *
@@ -3628,9 +3643,11 @@
 +module_param_named(debug, aufs_debug, int, S_IRUGO | S_IWUSR | S_IWGRP);
 +
 +char *au_plevel = KERN_DEBUG;
-+#define dpri(fmt, ...) do { \
-+	if (au_debug_test()) \
-+		printk("%s" fmt, au_plevel, ##__VA_ARGS__); \
++#define dpri(fmt, ...) do {					\
++	if ((au_plevel						\
++	     && strcmp(au_plevel, KERN_DEBUG))			\
++	    || au_debug_test())					\
++		printk("%s" fmt, au_plevel, ##__VA_ARGS__);	\
 +} while (0)
 +
 +/* ---------------------------------------------------------------------- */
@@ -3790,8 +3807,8 @@
 +	    && file->f_dentry
 +	    && au_test_aufs(file->f_dentry->d_sb)
 +	    && au_fi(file))
-+		snprintf(a, sizeof(a), ", mmapped %d",
-+			 !!au_fi(file)->fi_hvmop);
++		snprintf(a, sizeof(a), ", gen %d, mmapped %d",
++			 au_figen(file), !!au_fi(file)->fi_hvmop);
 +	dpri("f%d: mode 0x%x, flags 0%o, cnt %ld, v %llu, pos %llu%s\n",
 +	     bindex, file->f_mode, file->f_flags, (long)file_count(file),
 +	     file->f_version, file->f_pos, a);
@@ -3821,7 +3838,8 @@
 +	if (!fidir)
 +		do_pri_file(finfo->fi_btop, finfo->fi_htop.hf_file);
 +	else
-+		for (bindex = finfo->fi_btop; bindex <= fidir->fd_bbot;
++		for (bindex = finfo->fi_btop;
++		     bindex >= 0 && bindex <= fidir->fd_bbot;
 +		     bindex++) {
 +			hfile = fidir->fd_hfile + bindex;
 +			do_pri_file(bindex, hfile ? hfile->hf_file : NULL);
@@ -3974,12 +3992,26 @@
 +
 +void au_dbg_verify_kthread(void)
 +{
-+	if (current->flags & PF_WQ_WORKER) {
++	struct task_struct *tsk = current;
++
++	if ((tsk->flags & PF_KTHREAD)
++	    && !strncmp(tsk->comm, AUFS_WKQ_NAME "/", sizeof(AUFS_WKQ_NAME))) {
 +		au_dbg_blocked();
-+		WARN_ON(1);
++		BUG();
 +	}
 +}
 +
++static void au_dbg_do_verify_wkq(void *args)
++{
++	BUG_ON(current_fsuid());
++	BUG_ON(rlimit(RLIMIT_FSIZE) != RLIM_INFINITY);
++}
++
++void au_dbg_verify_wkq(void)
++{
++	au_wkq_wait(au_dbg_do_verify_wkq, NULL);
++}
++
 +/* ---------------------------------------------------------------------- */
 +
 +void au_debug_sbinfo_init(struct au_sbinfo *sbinfo __maybe_unused)
@@ -4023,10 +4055,9 @@
 +
 +	return 0;
 +}
-diff -urN /usr/share/empty/fs/aufs/debug.h linux/fs/aufs/debug.h
---- /usr/share/empty/fs/aufs/debug.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/debug.h	2010-10-21 09:52:43.086957936 +0200
-@@ -0,0 +1,243 @@
+--- /dev/null
++++ linux-2.6/fs/aufs/debug.h	2010-10-24 11:32:22.000000000 +0200
+@@ -0,0 +1,245 @@
 +/*
 + * Copyright (C) 2005-2010 Junjiro R. Okajima
 + *
@@ -4166,6 +4197,7 @@
 +void au_dbg_verify_nondir_parent(struct dentry *dentry, unsigned int sigen);
 +void au_dbg_verify_gen(struct dentry *parent, unsigned int sigen);
 +void au_dbg_verify_kthread(void);
++void au_dbg_verify_wkq(void);
 +
 +int __init au_debug_init(void);
 +void au_debug_sbinfo_init(struct au_sbinfo *sbinfo);
@@ -4231,6 +4263,7 @@
 +	   unsigned int sigen)
 +AuStubVoid(au_dbg_verify_gen, struct dentry *parent, unsigned int sigen)
 +AuStubVoid(au_dbg_verify_kthread, void)
++AuStubVoid(au_dbg_verify_wkq, void)
 +AuStubInt0(__init au_debug_init, void)
 +AuStubVoid(au_debug_sbinfo_init, struct au_sbinfo *sbinfo)
 +
@@ -4256,7 +4289,7 @@
 +#ifdef CONFIG_HW_CONSOLE
 +#define au_dbg_blocked() do { \
 +	WARN_ON(1); \
-+	handle_sysrq('w', vc_cons[fg_console].d->port.tty); \
++	handle_sysrq('w', vc_cons[fg_console].d->vc_tty); \
 +} while (0)
 +#else
 +AuStubVoid(au_dbg_blocked, void)
@@ -4270,10 +4303,9 @@
 +
 +#endif /* __KERNEL__ */
 +#endif /* __AUFS_DEBUG_H__ */
-diff -urN /usr/share/empty/fs/aufs/dentry.c linux/fs/aufs/dentry.c
---- /usr/share/empty/fs/aufs/dentry.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dentry.c	2010-10-21 09:52:43.086957936 +0200
-@@ -0,0 +1,851 @@
+--- /dev/null
++++ linux-2.6/fs/aufs/dentry.c	2010-10-24 11:32:50.000000000 +0200
+@@ -0,0 +1,860 @@
 +/*
 + * Copyright (C) 2005-2010 Junjiro R. Okajima
 + *
@@ -4905,9 +4937,8 @@
 +	name = &dentry->d_name;
 +
 +	/*
-+	 * Theoretically, REVAL test should be unnecessary in case of
-+	 * {FS,I}NOTIFY.
-+	 * But {fs,i}notify doesn't fire some necessary events,
++	 * Theoretically, REVAL test should be unnecessary in case of INOTIFY.
++	 * But inotify doesn't fire some necessary events,
 +	 *	IN_ATTRIB for atime/nlink/pageio
 +	 *	IN_DELETE for NFS dentry
 +	 * Let's do REVAL test too.
@@ -5066,10 +5097,19 @@
 +	struct super_block *sb;
 +	struct inode *inode;
 +
-+	err = -EINVAL;
++	valid = 1;
 +	sb = dentry->d_sb;
 +	inode = dentry->d_inode;
-+	aufs_read_lock(dentry, AuLock_FLUSH | AuLock_DW);
++	/*
++	 * todo: very ugly
++	 * i_mutex of parent dir may be held,
++	 * but we should not return 'invalid' due to busy.
++	 */
++	err = aufs_read_lock(dentry, AuLock_FLUSH | AuLock_DW | AuLock_NOPLM);
++	if (unlikely(err)) {
++		valid = err;
++		goto out;
++	}
 +	sigen = au_sigen(sb);
 +	if (au_digen(dentry) != sigen) {
 +		AuDebugOn(IS_ROOT(dentry));
@@ -5093,23 +5133,24 @@
 +
 +		if (bstart >= 0
 +		    && au_test_higen(inode, au_h_iptr(inode, bstart)))
-+			goto out;
++			goto out_inval;
 +	}
 +
 +	err = h_d_revalidate(dentry, inode, nd, do_udba);
 +	if (unlikely(!err && do_udba && au_dbstart(dentry) < 0))
 +		/* both of real entry and whiteout found */
 +		err = -EIO;
-+	goto out;
++	goto out_inval;
 +
 +out_dgrade:
 +	di_downgrade_lock(dentry, AuLock_IR);
-+out:
++out_inval:
 +	aufs_read_unlock(dentry, AuLock_IR);
 +	AuTraceErr(err);
 +	valid = !err;
++out:
 +	if (!valid)
-+		AuDbg("%.*s invalid\n", AuDLNPair(dentry));
++		AuDbg("%.*s invalid, %d\n", AuDLNPair(dentry), valid);
 +	return valid;
 +}
 +
@@ -5125,9 +5166,8 @@
 +	.d_revalidate	= aufs_d_revalidate,
 +	.d_release	= aufs_d_release
 +};
-diff -urN /usr/share/empty/fs/aufs/dentry.h linux/fs/aufs/dentry.h
---- /usr/share/empty/fs/aufs/dentry.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dentry.h	2010-10-21 09:52:43.086957936 +0200
+--- /dev/null
++++ linux-2.6/fs/aufs/dentry.h	2010-10-24 11:33:02.000000000 +0200
 @@ -0,0 +1,231 @@
 +/*
 + * Copyright (C) 2005-2010 Junjiro R. Okajima
@@ -5347,7 +5387,7 @@
 +#ifdef CONFIG_AUFS_HNOTIFY
 +static inline void au_digen_dec(struct dentry *d)
 +{
-+	atomic_dec_return(&au_di(d)->di_generation);
++	atomic_dec(&au_di(d)->di_generation);
 +}
 +
 +static inline void au_hn_di_reinit(struct dentry *dentry)
@@ -5360,10 +5400,9 @@
 +
 +#endif /* __KERNEL__ */
 +#endif /* __AUFS_DENTRY_H__ */
-diff -urN /usr/share/empty/fs/aufs/dinfo.c linux/fs/aufs/dinfo.c
---- /usr/share/empty/fs/aufs/dinfo.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dinfo.c	2010-10-21 09:52:43.086957936 +0200
-@@ -0,0 +1,395 @@
+--- /dev/null
++++ linux-2.6/fs/aufs/dinfo.c	2010-10-24 11:33:24.000000000 +0200
+@@ -0,0 +1,397 @@
 +/*
 + * Copyright (C) 2005-2010 Junjiro R. Okajima
 + *
@@ -5388,11 +5427,13 @@
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/kernel/kernel-aufs2.patch?r1=1.10&r2=1.11&f=u



More information about the pld-cvs-commit mailing list