packages: kernel/kernel-unionfs.patch - http://download.filesystems.org/uni...

baggins baggins at pld-linux.org
Mon Jul 11 21:51:18 CEST 2011


Author: baggins                      Date: Mon Jul 11 19:51:18 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- http://download.filesystems.org/unionfs/unionfs-2.x-latest/unionfs-2.5.9.2_for_3.0.0-rc4.diff.gz

---- Files affected:
packages/kernel:
   kernel-unionfs.patch (1.13 -> 1.14) 

---- Diffs:

================================================================
Index: packages/kernel/kernel-unionfs.patch
diff -u packages/kernel/kernel-unionfs.patch:1.13 packages/kernel/kernel-unionfs.patch:1.14
--- packages/kernel/kernel-unionfs.patch:1.13	Fri Mar 25 16:08:26 2011
+++ packages/kernel/kernel-unionfs.patch	Mon Jul 11 21:51:13 2011
@@ -532,10 +532,10 @@
 +
 +For more information, see <http://unionfs.filesystems.org/>.
 diff --git a/MAINTAINERS b/MAINTAINERS
-index 560ecce..09e38d6 100644
+index f0358cd..7ae0669 100644
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -6276,6 +6276,14 @@ F:	Documentation/cdrom/
+@@ -6375,6 +6375,14 @@ F:	Documentation/cdrom/
  F:	drivers/cdrom/cdrom.c
  F:	include/linux/cdrom.h
  
@@ -551,10 +551,10 @@
  M:	Artem Bityutskiy <dedekind1 at gmail.com>
  W:	http://www.linux-mtd.infradead.org/
 diff --git a/fs/Kconfig b/fs/Kconfig
-index 3db9caa..3dc2dfd 100644
+index 19891aa..ac8a074 100644
 --- a/fs/Kconfig
 +++ b/fs/Kconfig
-@@ -170,6 +170,7 @@ if MISC_FILESYSTEMS
+@@ -187,6 +187,7 @@ if MISC_FILESYSTEMS
  source "fs/adfs/Kconfig"
  source "fs/affs/Kconfig"
  source "fs/ecryptfs/Kconfig"
@@ -563,10 +563,10 @@
  source "fs/hfsplus/Kconfig"
  source "fs/befs/Kconfig"
 diff --git a/fs/Makefile b/fs/Makefile
-index a7f7cef..672664b 100644
+index fb68c2b..8ca9290 100644
 --- a/fs/Makefile
 +++ b/fs/Makefile
-@@ -81,6 +81,7 @@ obj-$(CONFIG_ISO9660_FS)	+= isofs/
+@@ -83,6 +83,7 @@ obj-$(CONFIG_ISO9660_FS)	+= isofs/
  obj-$(CONFIG_HFSPLUS_FS)	+= hfsplus/ # Before hfs to find wrapped HFS+
  obj-$(CONFIG_HFS_FS)		+= hfs/
  obj-$(CONFIG_ECRYPT_FS)		+= ecryptfs/
@@ -575,10 +575,10 @@
  obj-$(CONFIG_NFS_FS)		+= nfs/
  obj-$(CONFIG_EXPORTFS)		+= exportfs/
 diff --git a/fs/namei.c b/fs/namei.c
-index 0087cf9..d3118a7 100644
+index 0223c41..5d0261e 100644
 --- a/fs/namei.c
 +++ b/fs/namei.c
-@@ -562,6 +562,7 @@ void release_open_intent(struct nameidata *nd)
+@@ -484,6 +484,7 @@ void release_open_intent(struct nameidata *nd)
  			fput(file);
  	}
  }
@@ -586,11 +586,62 @@
  
  static inline int d_revalidate(struct dentry *dentry, struct nameidata *nd)
  {
+@@ -1740,6 +1741,42 @@ struct dentry *lookup_one_len(const char *name, struct dentry *base, int len)
+ 	return __lookup_hash(&this, base, NULL);
+ }
+ 
++/* pass nameidata from caller (useful for NFS) */
++struct dentry *lookup_one_len_nd(const char *name, struct dentry *base,
++				 int len, struct nameidata *nd)
++{
++	struct qstr this;
++	unsigned long hash;
++	unsigned int c;
++
++	WARN_ON_ONCE(!mutex_is_locked(&base->d_inode->i_mutex));
++
++	this.name = name;
++	this.len = len;
++	if (!len)
++		return ERR_PTR(-EACCES);
++
++	hash = init_name_hash();
++	while (len--) {
++		c = *(const unsigned char *)name++;
++		if (c == '/' || c == '\0')
++			return ERR_PTR(-EACCES);
++		hash = partial_name_hash(c, hash);
++	}
++	this.hash = end_name_hash(hash);
++	/*
++	 * See if the low-level filesystem might want
++	 * to use its own hash..
++	 */
++	if (base->d_flags & DCACHE_OP_HASH) {
++		int err = base->d_op->d_hash(base, base->d_inode, &this);
++		if (err < 0)
++			return ERR_PTR(err);
++	}
++
++	return __lookup_hash(&this, base, nd);
++}
++
+ int user_path_at(int dfd, const char __user *name, unsigned flags,
+ 		 struct path *path)
+ {
+@@ -3339,6 +3376,7 @@ EXPORT_SYMBOL(get_write_access); /* binfmt_aout */
+ EXPORT_SYMBOL(getname);
+ EXPORT_SYMBOL(lock_rename);
+ EXPORT_SYMBOL(lookup_one_len);
++EXPORT_SYMBOL(lookup_one_len_nd);
+ EXPORT_SYMBOL(page_follow_link_light);
+ EXPORT_SYMBOL(page_put_link);
+ EXPORT_SYMBOL(page_readlink);
 diff --git a/fs/splice.c b/fs/splice.c
-index 50a5d97..a3af841 100644
+index aa866d3..421ab86 100644
 --- a/fs/splice.c
 +++ b/fs/splice.c
-@@ -1081,8 +1081,8 @@ EXPORT_SYMBOL(generic_splice_sendpage);
+@@ -1085,8 +1085,8 @@ EXPORT_SYMBOL(generic_splice_sendpage);
  /*
   * Attempt to initiate a splice from pipe to file.
   */
@@ -601,7 +652,7 @@
  {
  	ssize_t (*splice_write)(struct pipe_inode_info *, struct file *,
  				loff_t *, size_t, unsigned int);
-@@ -1105,13 +1105,14 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
+@@ -1109,13 +1109,14 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
  
  	return splice_write(pipe, out, ppos, len, flags);
  }
@@ -619,7 +670,7 @@
  {
  	ssize_t (*splice_read)(struct file *, loff_t *,
  			       struct pipe_inode_info *, size_t, unsigned int);
-@@ -1131,6 +1132,7 @@ static long do_splice_to(struct file *in, loff_t *ppos,
+@@ -1135,6 +1136,7 @@ static long do_splice_to(struct file *in, loff_t *ppos,
  
  	return splice_read(in, ppos, pipe, len, flags);
  }
@@ -627,7 +678,7 @@
  
  /**
   * splice_direct_to_actor - splices data directly between two non-pipes
-@@ -1200,7 +1202,7 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd,
+@@ -1204,7 +1206,7 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd,
  		size_t read_len;
  		loff_t pos = sd->pos, prev_pos = pos;
  
@@ -636,7 +687,7 @@
  		if (unlikely(ret <= 0))
  			goto out_release;
  
-@@ -1259,8 +1261,8 @@ static int direct_splice_actor(struct pipe_inode_info *pipe,
+@@ -1263,8 +1265,8 @@ static int direct_splice_actor(struct pipe_inode_info *pipe,
  {
  	struct file *file = sd->u.file;
  
@@ -647,7 +698,7 @@
  }
  
  /**
-@@ -1345,7 +1347,7 @@ static long do_splice(struct file *in, loff_t __user *off_in,
+@@ -1349,7 +1351,7 @@ static long do_splice(struct file *in, loff_t __user *off_in,
  		} else
  			off = &out->f_pos;
  
@@ -656,7 +707,7 @@
  
  		if (off_out && copy_to_user(off_out, off, sizeof(loff_t)))
  			ret = -EFAULT;
-@@ -1365,7 +1367,7 @@ static long do_splice(struct file *in, loff_t __user *off_in,
+@@ -1369,7 +1371,7 @@ static long do_splice(struct file *in, loff_t __user *off_in,
  		} else
  			off = &in->f_pos;
  
@@ -723,11 +774,11 @@
 +	  If you say Y here, you can turn on debugging output from Unionfs.
 diff --git a/fs/unionfs/Makefile b/fs/unionfs/Makefile
 new file mode 100644
-index 0000000..10a321a
+index 0000000..0ece303
 --- /dev/null
 +++ b/fs/unionfs/Makefile
 @@ -0,0 +1,17 @@
-+UNIONFS_VERSION="2.5.8 (for 2.6.38-rc7)"
++UNIONFS_VERSION="2.5.9.2 (for 3.0.0-rc4)"
 +
 +EXTRA_CFLAGS += -DUNIONFS_VERSION=\"$(UNIONFS_VERSION)\"
 +
@@ -746,12 +797,12 @@
 +endif
 diff --git a/fs/unionfs/commonfops.c b/fs/unionfs/commonfops.c
 new file mode 100644
-index 0000000..51ea65e
+index 0000000..0a271f4
 --- /dev/null
 +++ b/fs/unionfs/commonfops.c
 @@ -0,0 +1,896 @@
 +/*
-+ * Copyright (c) 2003-2010 Erez Zadok
++ * Copyright (c) 2003-2011 Erez Zadok
 + * Copyright (c) 2003-2006 Charles P. Wright
 + * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
 + * Copyright (c) 2005-2006 Junjiro Okajima
@@ -760,8 +811,8 @@
 + * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
 + * Copyright (c) 2003      Puja Gupta
 + * Copyright (c) 2003      Harikesavan Krishnan
-+ * Copyright (c) 2003-2010 Stony Brook University
-+ * Copyright (c) 2003-2010 The Research Foundation of SUNY
++ * Copyright (c) 2003-2011 Stony Brook University
++ * Copyright (c) 2003-2011 The Research Foundation of SUNY
 + *
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License version 2 as
@@ -1064,7 +1115,7 @@
 +	 * someone has copied up this file from underneath us, we also need
 +	 * to refresh things.
 +	 */
-+	if (d_deleted(dentry) ||
++	if ((d_deleted(dentry) && dbstart(dentry) >= fbstart(file)) ||
 +	    (sbgen <= fgen &&
 +	     dbstart(dentry) == fbstart(file) &&
 +	     unionfs_lower_file(file)))
@@ -1258,8 +1309,11 @@
 +			for (bindex = bstart - 1; bindex >= 0; bindex--) {
 +				err = copyup_file(parent->d_inode, file,
 +						  bstart, bindex, size);
-+				if (!err)
++				if (!err) {
++					/* only one regular file open */
++					fbend(file) = fbstart(file);
 +					break;
++				}
 +			}
 +			return err;
 +		} else {
@@ -1400,7 +1454,7 @@
 +	struct dentry *dentry = file->f_path.dentry;
 +	struct dentry *parent;
 +	int bindex, bstart, bend;
-+	int fgen, err = 0;
++	int err = 0;
 +
 +	/*
 +	 * Since mm/memory.c:might_fault() (under PROVE_LOCKING) was
@@ -1436,7 +1490,6 @@
 +	inodeinfo = UNIONFS_I(inode);
 +
 +	/* fput all the lower files */
-+	fgen = atomic_read(&fileinfo->generation);
 +	bstart = fbstart(file);
 +	bend = fbend(file);
 +
@@ -1492,10 +1545,8 @@
 +	if (lower_file->f_op->unlocked_ioctl) {
 +		err = lower_file->f_op->unlocked_ioctl(lower_file, cmd, arg);
 +#ifdef CONFIG_COMPAT
-+	} else if (lower_file->f_op->ioctl) {
-+		err = lower_file->f_op->compat_ioctl(
-+			lower_file->f_path.dentry->d_inode,
-+			lower_file, cmd, arg);
++	} else if (lower_file->f_op->compat_ioctl) {
++		err = lower_file->f_op->compat_ioctl(lower_file, cmd, arg);
 +#endif
 +	}
 +
@@ -1648,12 +1699,12 @@
 +}
 diff --git a/fs/unionfs/copyup.c b/fs/unionfs/copyup.c
 new file mode 100644
-index 0000000..bba3a75
+index 0000000..37c2654
 --- /dev/null
 +++ b/fs/unionfs/copyup.c
 @@ -0,0 +1,896 @@
 +/*
-+ * Copyright (c) 2003-2010 Erez Zadok
++ * Copyright (c) 2003-2011 Erez Zadok
 + * Copyright (c) 2003-2006 Charles P. Wright
 + * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
 + * Copyright (c) 2005-2006 Junjiro Okajima
@@ -1662,8 +1713,8 @@
 + * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
 + * Copyright (c) 2003      Puja Gupta
 + * Copyright (c) 2003      Harikesavan Krishnan
-+ * Copyright (c) 2003-2010 Stony Brook University
-+ * Copyright (c) 2003-2010 The Research Foundation of SUNY
++ * Copyright (c) 2003-2011 Stony Brook University
++ * Copyright (c) 2003-2011 The Research Foundation of SUNY
 + *
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License version 2 as
@@ -2550,15 +2601,15 @@
 +}
 diff --git a/fs/unionfs/debug.c b/fs/unionfs/debug.c
 new file mode 100644
-index 0000000..a76f92a
+index 0000000..6092e69
 --- /dev/null
 +++ b/fs/unionfs/debug.c
 @@ -0,0 +1,548 @@
 +/*
-+ * Copyright (c) 2003-2010 Erez Zadok
++ * Copyright (c) 2003-2011 Erez Zadok
 + * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
-+ * Copyright (c) 2003-2010 Stony Brook University
-+ * Copyright (c) 2003-2010 The Research Foundation of SUNY
++ * Copyright (c) 2003-2011 Stony Brook University
++ * Copyright (c) 2003-2011 The Research Foundation of SUNY
 + *
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License version 2 as
@@ -3104,12 +3155,12 @@
 +}
 diff --git a/fs/unionfs/dentry.c b/fs/unionfs/dentry.c
 new file mode 100644
-index 0000000..a0c3bba
+index 0000000..c0205a4
 --- /dev/null
 +++ b/fs/unionfs/dentry.c
-@@ -0,0 +1,397 @@
+@@ -0,0 +1,406 @@
 +/*
-+ * Copyright (c) 2003-2010 Erez Zadok
++ * Copyright (c) 2003-2011 Erez Zadok
 + * Copyright (c) 2003-2006 Charles P. Wright
 + * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
 + * Copyright (c) 2005-2006 Junjiro Okajima
@@ -3118,8 +3169,8 @@
 + * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
 + * Copyright (c) 2003      Puja Gupta
 + * Copyright (c) 2003      Harikesavan Krishnan
-+ * Copyright (c) 2003-2010 Stony Brook University
-+ * Copyright (c) 2003-2010 The Research Foundation of SUNY
++ * Copyright (c) 2003-2011 Stony Brook University
++ * Copyright (c) 2003-2011 The Research Foundation of SUNY
 + *
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License version 2 as
@@ -3302,6 +3353,9 @@
 +	bend = dbend(dentry);
 +	BUG_ON(bstart == -1);
 +	for (bindex = bstart; bindex <= bend; bindex++) {
++		int err;
++		struct nameidata lower_nd;
++
 +		lower_dentry = unionfs_lower_dentry_idx(dentry, bindex);
 +		if (!lower_dentry || !lower_dentry->d_op
 +		    || !lower_dentry->d_op->d_revalidate)
@@ -3314,8 +3368,14 @@
 +		 * invariants).  We will open lower files as and when needed
 +		 * later on.
 +		 */
-+		if (!lower_dentry->d_op->d_revalidate(lower_dentry, NULL))
++		err = init_lower_nd(&lower_nd, LOOKUP_OPEN);
++		if (unlikely(err < 0)) {
++			valid = false;
++			break;
++		}
++		if (!lower_dentry->d_op->d_revalidate(lower_dentry, &lower_nd))
 +			valid = false;
++		release_lower_nd(&lower_nd, err);
 +	}
 +
 +	if (!dentry->d_inode ||
@@ -3507,12 +3567,12 @@
 +};
 diff --git a/fs/unionfs/dirfops.c b/fs/unionfs/dirfops.c
 new file mode 100644
-index 0000000..7da0ff0
+index 0000000..72a9c1a
 --- /dev/null
 +++ b/fs/unionfs/dirfops.c
 @@ -0,0 +1,302 @@
 +/*
-+ * Copyright (c) 2003-2010 Erez Zadok
++ * Copyright (c) 2003-2011 Erez Zadok
 + * Copyright (c) 2003-2006 Charles P. Wright
 + * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
 + * Copyright (c) 2005-2006 Junjiro Okajima
@@ -3521,8 +3581,8 @@
 + * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
 + * Copyright (c) 2003      Puja Gupta
 + * Copyright (c) 2003      Harikesavan Krishnan
-+ * Copyright (c) 2003-2010 Stony Brook University
-+ * Copyright (c) 2003-2010 The Research Foundation of SUNY
++ * Copyright (c) 2003-2011 Stony Brook University
++ * Copyright (c) 2003-2011 The Research Foundation of SUNY
 + *
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License version 2 as
@@ -3815,12 +3875,12 @@
 +};
 diff --git a/fs/unionfs/dirhelper.c b/fs/unionfs/dirhelper.c
 new file mode 100644
-index 0000000..033343b
+index 0000000..62ec9af
 --- /dev/null
 +++ b/fs/unionfs/dirhelper.c
 @@ -0,0 +1,158 @@
 +/*
-+ * Copyright (c) 2003-2010 Erez Zadok
++ * Copyright (c) 2003-2011 Erez Zadok
 + * Copyright (c) 2003-2006 Charles P. Wright
 + * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
 + * Copyright (c) 2005-2006 Junjiro Okajima
@@ -3829,8 +3889,8 @@
 + * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
 + * Copyright (c) 2003      Puja Gupta
 + * Copyright (c) 2003      Harikesavan Krishnan
-+ * Copyright (c) 2003-2010 Stony Brook University
-+ * Copyright (c) 2003-2010 The Research Foundation of SUNY
++ * Copyright (c) 2003-2011 Stony Brook University
++ * Copyright (c) 2003-2011 The Research Foundation of SUNY
 + *
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License version 2 as
@@ -3979,12 +4039,12 @@
 +}
 diff --git a/fs/unionfs/fanout.h b/fs/unionfs/fanout.h
 new file mode 100644
-index 0000000..5b77eac
+index 0000000..ae1b86a
 --- /dev/null
 +++ b/fs/unionfs/fanout.h
 @@ -0,0 +1,407 @@
 +/*
-+ * Copyright (c) 2003-2010 Erez Zadok
++ * Copyright (c) 2003-2011 Erez Zadok
 + * Copyright (c) 2003-2006 Charles P. Wright
 + * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
 + * Copyright (c) 2005      Arun M. Krishnakumar
@@ -3992,8 +4052,8 @@
 + * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
 + * Copyright (c) 2003      Puja Gupta
 + * Copyright (c) 2003      Harikesavan Krishnan
-+ * Copyright (c) 2003-2010 Stony Brook University
-+ * Copyright (c) 2003-2010 The Research Foundation of SUNY
++ * Copyright (c) 2003-2011 Stony Brook University
++ * Copyright (c) 2003-2011 The Research Foundation of SUNY
 + *
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License version 2 as
@@ -4392,12 +4452,12 @@
 +#endif	/* not _FANOUT_H */
 diff --git a/fs/unionfs/file.c b/fs/unionfs/file.c
 new file mode 100644
-index 0000000..1c694c3
+index 0000000..416c52f
 --- /dev/null
 +++ b/fs/unionfs/file.c
 @@ -0,0 +1,382 @@
 +/*
-+ * Copyright (c) 2003-2010 Erez Zadok
++ * Copyright (c) 2003-2011 Erez Zadok
 + * Copyright (c) 2003-2006 Charles P. Wright
 + * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
 + * Copyright (c) 2005-2006 Junjiro Okajima
@@ -4406,8 +4466,8 @@
 + * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
 + * Copyright (c) 2003      Puja Gupta
 + * Copyright (c) 2003      Harikesavan Krishnan
-+ * Copyright (c) 2003-2010 Stony Brook University
-+ * Copyright (c) 2003-2010 The Research Foundation of SUNY
++ * Copyright (c) 2003-2011 Stony Brook University
++ * Copyright (c) 2003-2011 The Research Foundation of SUNY
 + *
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License version 2 as
@@ -4780,12 +4840,12 @@
 +};
 diff --git a/fs/unionfs/inode.c b/fs/unionfs/inode.c
 new file mode 100644
-index 0000000..0066238
+index 0000000..b207c13
 --- /dev/null
 +++ b/fs/unionfs/inode.c
-@@ -0,0 +1,1077 @@
+@@ -0,0 +1,1099 @@
 +/*
-+ * Copyright (c) 2003-2010 Erez Zadok
++ * Copyright (c) 2003-2011 Erez Zadok
 + * Copyright (c) 2003-2006 Charles P. Wright
 + * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
 + * Copyright (c) 2005-2006 Junjiro Okajima
@@ -4794,8 +4854,8 @@
 + * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
 + * Copyright (c) 2003      Puja Gupta
 + * Copyright (c) 2003      Harikesavan Krishnan
-+ * Copyright (c) 2003-2010 Stony Brook University
-+ * Copyright (c) 2003-2010 The Research Foundation of SUNY
++ * Copyright (c) 2003-2011 Stony Brook University
++ * Copyright (c) 2003-2011 The Research Foundation of SUNY
 + *
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License version 2 as
@@ -5575,17 +5635,23 @@
 +	struct inode *lower_inode = NULL;
 +	int err = 0;
 +	int bindex, bstart, bend;
-+	const int is_file = !S_ISDIR(inode->i_mode);
++	int is_file;
 +	const int write_mask = (mask & MAY_WRITE) && !(mask & MAY_READ);
-+	struct inode *inode_grabbed = igrab(inode);
-+	struct dentry *dentry = d_find_alias(inode);
++	struct inode *inode_grabbed;
++	struct dentry *dentry;
 +
-+	if (flags & IPERM_FLAG_RCU)
-+		return -ECHILD;
++	if (flags & IPERM_FLAG_RCU) {
++		err = -ECHILD;
++		goto out_nograb;
++	}
 +
++	dentry = d_find_alias(inode);
 +	if (dentry)
 +		unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
 +
++	inode_grabbed = igrab(inode);
++	is_file = !S_ISDIR(inode->i_mode);
++
 +	if (!UNIONFS_I(inode)->lower_inodes) {
 +		if (is_file)	/* dirs can be unlinked but chdir'ed to */
 +			err = -ESTALE;	/* force revalidate */
@@ -5678,6 +5744,7 @@
 +		dput(dentry);
 +	}
 +	iput(inode_grabbed);
++out_nograb:
 +	return err;
 +}
 +
@@ -5722,7 +5789,12 @@
 +		err = -EINVAL;
 +		goto out;
 +	}
-+	lower_inode = unionfs_lower_inode(inode);
++
++	/*
++	 * Get the lower inode directly from lower dentry, in case ibstart
++	 * is -1 (which happens when the file is open but unlinked.
++	 */
++	lower_inode = lower_dentry->d_inode;
 +
 +	/* check if user has permission to change lower inode */
 +	err = inode_change_ok(lower_inode, ia);
@@ -5757,6 +5829,16 @@
 +		/* get updated lower_dentry/inode after copyup */
 +		lower_dentry = unionfs_lower_dentry(dentry);
 +		lower_inode = unionfs_lower_inode(inode);
++		/*
++		 * check for whiteouts in writeable branch, and remove them
++		 * if necessary.
++		 */
++		if (lower_dentry) {
++			err = check_unlink_whiteout(dentry, lower_dentry,
++						    bindex);
++			if (err > 0) /* ignore if whiteout found and removed */
++				err = 0;
++		}
 +	}
 +
 +	/*
@@ -5863,12 +5945,12 @@
 +};
 diff --git a/fs/unionfs/lookup.c b/fs/unionfs/lookup.c
 new file mode 100644
-index 0000000..b63c17e
+index 0000000..3cbde56
 --- /dev/null
 +++ b/fs/unionfs/lookup.c
 @@ -0,0 +1,569 @@
 +/*
-+ * Copyright (c) 2003-2010 Erez Zadok
++ * Copyright (c) 2003-2011 Erez Zadok
 + * Copyright (c) 2003-2006 Charles P. Wright
 + * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
 + * Copyright (c) 2005-2006 Junjiro Okajima
@@ -5877,8 +5959,8 @@
 + * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
 + * Copyright (c) 2003      Puja Gupta
 + * Copyright (c) 2003      Harikesavan Krishnan
-+ * Copyright (c) 2003-2010 Stony Brook University
-+ * Copyright (c) 2003-2010 The Research Foundation of SUNY
++ * Copyright (c) 2003-2011 Stony Brook University
++ * Copyright (c) 2003-2011 The Research Foundation of SUNY
 + *
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License version 2 as
@@ -6438,12 +6520,12 @@
 +}
 diff --git a/fs/unionfs/main.c b/fs/unionfs/main.c
 new file mode 100644
-index 0000000..9ee58eb
<<Diff was trimmed, longer than 597 lines>>

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



More information about the pld-cvs-commit mailing list