packages: kernel-desktop/kernel-desktop-unionfs.patch - update for 2.6.34

shadzik shadzik at pld-linux.org
Mon Aug 9 16:05:50 CEST 2010


Author: shadzik                      Date: Mon Aug  9 14:05:50 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- update for 2.6.34

---- Files affected:
packages/kernel-desktop:
   kernel-desktop-unionfs.patch (1.2 -> 1.3) 

---- Diffs:

================================================================
Index: packages/kernel-desktop/kernel-desktop-unionfs.patch
diff -u packages/kernel-desktop/kernel-desktop-unionfs.patch:1.2 packages/kernel-desktop/kernel-desktop-unionfs.patch:1.3
--- packages/kernel-desktop/kernel-desktop-unionfs.patch:1.2	Wed Apr  9 00:19:09 2008
+++ packages/kernel-desktop/kernel-desktop-unionfs.patch	Mon Aug  9 16:05:44 2010
@@ -1,8 +1,8 @@
 diff --git a/Documentation/filesystems/00-INDEX b/Documentation/filesystems/00-INDEX
-index 1de155e..b168331 100644
+index 875d496..0a9acac 100644
 --- a/Documentation/filesystems/00-INDEX
 +++ b/Documentation/filesystems/00-INDEX
-@@ -96,6 +96,8 @@ udf.txt
+@@ -106,6 +106,8 @@ udf.txt
  	- info and mount options for the UDF filesystem.
  ufs.txt
  	- info on the ufs filesystem.
@@ -29,10 +29,10 @@
 +	- Usage information and examples.
 diff --git a/Documentation/filesystems/unionfs/concepts.txt b/Documentation/filesystems/unionfs/concepts.txt
 new file mode 100644
-index 0000000..bed69bd
+index 0000000..b853788
 --- /dev/null
 +++ b/Documentation/filesystems/unionfs/concepts.txt
-@@ -0,0 +1,213 @@
+@@ -0,0 +1,287 @@
 +Unionfs 2.x CONCEPTS:
 +=====================
 +
@@ -87,6 +87,42 @@
 +eliminate 'foo' from the namespace (as well as the whiteout itself.)
 +
 +
++Opaque Directories:
++===================
++
++Assume we have a unionfs mount comprising of two branches.  Branch 0 is
++empty; branch 1 has the directory /a and file /a/f.  Let's say we mount a
++union of branch 0 as read-write and branch 1 as read-only.  Now, let's say
++we try to perform the following operation in the union:
++
++	rm -fr a
++
++Because branch 1 is not writable, we cannot physically remove the file /a/f
++or the directory /a.  So instead, we will create a whiteout in branch 0
++named /.wh.a, masking out the name "a" from branch 1.  Next, let's say we
++try to create a directory named "a" as follows:
++
++	mkdir a
++
++Because we have a whiteout for "a" already, Unionfs behaves as if "a"
++doesn't exist, and thus will delete the whiteout and replace it with an
++actual directory named "a".
++
++The problem now is that if you try to "ls" in the union, Unionfs will
++perform is normal directory name unification, for *all* directories named
++"a" in all branches.  This will cause the file /a/f from branch 1 to
++re-appear in the union's namespace, which violates Unix semantics.
++
++To avoid this problem, we have a different form of whiteouts for
++directories, called "opaque directories" (same as BSD Union Mount does).
++Whenever we replace a whiteout with a directory, that directory is marked as
++opaque.  In Unionfs 2.x, it means that we create a file named
++/a/.wh.__dir_opaque in branch 0, after having created directory /a there.
++When unionfs notices that a directory is opaque, it stops all namespace
++operations (including merging readdir contents) at that opaque directory.
++This prevents re-exposing names from masked out directories.
++
++
 +Duplicate Elimination:
 +======================
 +
@@ -97,6 +133,31 @@
 +(numerically lowest value) and "hide" the others.
 +
 +
++Unlinking:
++=========
++
++Unlink operation on non-directory instances is optimized to remove the
++maximum possible objects in case multiple underlying branches have the same
++file name.  The unlink operation will first try to delete file instances
++from highest priority branch and then move further to delete from remaining
++branches in order of their decreasing priority.  Consider a case (F..D..F),
++where F is a file and D is a directory of the same name; here, some
++intermediate branch could have an empty directory instance with the same
++name, so this operation also tries to delete this directory instance and
++proceed further to delete from next possible lower priority branch.  The
++unionfs unlink operation will smoothly delete the files with same name from
++all possible underlying branches.  In case if some error occurs, it creates
++whiteout in highest priority branch that will hide file instance in rest of
++the branches.  An error could occur either if an unlink operations in any of
++the underlying branch failed or if a branch has no write permission.
++
++This unlinking policy is known as "delete all" and it has the benefit of
++overall reducing the number of inodes used by duplicate files, and further
++reducing the total number of inodes consumed by whiteouts.  The cost is of
++extra processing, but testing shows this extra processing is well worth the
++savings.
++
++
 +Copyup:
 +=======
 +
@@ -245,6 +306,19 @@
 +for the same file(s).  Lastly, this delayed time attribute detection is
 +similar to how NFS clients operate (e.g., acregmin).
 +
++Finally, there is no way currently in Linux to prevent lower directories
++from being moved around (i.e., topology changes); there's no way to prevent
++modifications to directory sub-trees of whole file systems which are mounted
++read-write.  It is therefore possible for in-flight operations in unionfs to
++take place, while a lower directory is being moved around.  Therefore, if
++you try to, say, create a new file in a directory through unionfs, while the
++directory is being moved around directly, then the new file may get created
++in the new location where that directory was moved to.  This is a somewhat
++similar behaviour in NFS: an NFS client could be creating a new file while
++th NFS server is moving th directory around; the file will get successfully
++created in the new location.  (The one exception in unionfs is that if the
++branch is marked read-only by unionfs, then a copyup will take place.)
++
 +For more information, see <http://unionfs.filesystems.org/>.
 diff --git a/Documentation/filesystems/unionfs/issues.txt b/Documentation/filesystems/unionfs/issues.txt
 new file mode 100644
@@ -458,178 +532,147 @@
 +
 +For more information, see <http://unionfs.filesystems.org/>.
 diff --git a/MAINTAINERS b/MAINTAINERS
-index b4f611c..d68b687 100644
+index 317ed38..582ffe5 100644
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -3804,6 +3804,15 @@ L:	linux-kernel at vger.kernel.org
- W:	http://www.kernel.dk
- S:	Maintained
+@@ -5452,6 +5452,14 @@ F:	Documentation/cdrom/
+ F:	drivers/cdrom/cdrom.c
+ F:	include/linux/cdrom.h
  
 +UNIONFS
 +P:	Erez Zadok
 +M:	ezk at cs.sunysb.edu
-+P:	Josef "Jeff" Sipek
-+M:	jsipek at cs.sunysb.edu
 +L:	unionfs at filesystems.org
-+W:	http://unionfs.filesystems.org
++W:	http://unionfs.filesystems.org/
++T:	git git.kernel.org/pub/scm/linux/kernel/git/ezk/unionfs.git
 +S:	Maintained
 +
- USB ACM DRIVER
- P:	Oliver Neukum
- M:	oliver at neukum.name
+ UNSORTED BLOCK IMAGES (UBI)
+ M:	Artem Bityutskiy <dedekind1 at gmail.com>
+ W:	http://www.linux-mtd.infradead.org/
 diff --git a/fs/Kconfig b/fs/Kconfig
-index 487236c..55a78b7 100644
+index 64d44ef..b69e2f2 100644
 --- a/fs/Kconfig
 +++ b/fs/Kconfig
-@@ -1041,6 +1041,47 @@ config CONFIGFS_FS
- 
- endmenu
- 
-+menu "Layered filesystems"
-+
-+config ECRYPT_FS
-+	tristate "eCrypt filesystem layer support (EXPERIMENTAL)"
-+	depends on EXPERIMENTAL && KEYS && CRYPTO && NET
-+	help
-+	  Encrypted filesystem that operates on the VFS layer.  See
-+	  <file:Documentation/filesystems/ecryptfs.txt> to learn more about
-+	  eCryptfs.  Userspace components are required and can be
-+	  obtained from <http://ecryptfs.sf.net>.
-+
-+	  To compile this file system support as a module, choose M here: the
-+	  module will be called ecryptfs.
-+
-+config UNION_FS
-+	tristate "Union file system (EXPERIMENTAL)"
-+	depends on EXPERIMENTAL
-+	help
-+	  Unionfs is a stackable unification file system, which appears to
-+	  merge the contents of several directories (branches), while keeping
-+	  their physical content separate.
-+
-+	  See <http://unionfs.filesystems.org> for details
-+
-+config UNION_FS_XATTR
-+	bool "Unionfs extended attributes"
-+	depends on UNION_FS
-+	help
-+	  Extended attributes are name:value pairs associated with inodes by
-+	  the kernel or by users (see the attr(5) manual page).
-+
-+	  If unsure, say N.
-+
-+config UNION_FS_DEBUG
-+	bool "Debug Unionfs"
-+	depends on UNION_FS
-+	help
-+	  If you say Y here, you can turn on debugging output from Unionfs.
-+
-+endmenu
-+
- menu "Miscellaneous filesystems"
- 
- config ADFS_FS
-@@ -1093,18 +1134,6 @@ config AFFS_FS
- 	  To compile this file system support as a module, choose M here: the
- 	  module will be called affs.  If unsure, say N.
- 
--config ECRYPT_FS
--	tristate "eCrypt filesystem layer support (EXPERIMENTAL)"
--	depends on EXPERIMENTAL && KEYS && CRYPTO && NET
--	help
--	  Encrypted filesystem that operates on the VFS layer.  See
--	  <file:Documentation/filesystems/ecryptfs.txt> to learn more about
--	  eCryptfs.  Userspace components are required and can be
--	  obtained from <http://ecryptfs.sf.net>.
--
--	  To compile this file system support as a module, choose M here: the
--	  module will be called ecryptfs.
--
- config HFS_FS
- 	tristate "Apple Macintosh file system support (EXPERIMENTAL)"
- 	depends on BLOCK && EXPERIMENTAL
+@@ -169,6 +169,7 @@ if MISC_FILESYSTEMS
+ source "fs/adfs/Kconfig"
+ source "fs/affs/Kconfig"
+ source "fs/ecryptfs/Kconfig"
++source "fs/unionfs/Kconfig"
+ source "fs/hfs/Kconfig"
+ source "fs/hfsplus/Kconfig"
+ source "fs/befs/Kconfig"
 diff --git a/fs/Makefile b/fs/Makefile
-index 500cf15..e202288 100644
+index af6d047..6c254d5 100644
 --- a/fs/Makefile
 +++ b/fs/Makefile
-@@ -118,3 +118,4 @@ obj-$(CONFIG_HPPFS)		+= hppfs/
- obj-$(CONFIG_DEBUG_FS)		+= debugfs/
- obj-$(CONFIG_OCFS2_FS)		+= ocfs2/
- obj-$(CONFIG_GFS2_FS)           += gfs2/
+@@ -84,6 +84,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/
 +obj-$(CONFIG_UNION_FS)		+= unionfs/
-diff --git a/fs/ecryptfs/dentry.c b/fs/ecryptfs/dentry.c
-index cb20b96..a8c1686 100644
---- a/fs/ecryptfs/dentry.c
-+++ b/fs/ecryptfs/dentry.c
-@@ -62,7 +62,7 @@ static int ecryptfs_d_revalidate(struct dentry *dentry, struct nameidata *nd)
- 		struct inode *lower_inode =
- 			ecryptfs_inode_to_lower(dentry->d_inode);
- 
--		fsstack_copy_attr_all(dentry->d_inode, lower_inode, NULL);
-+		fsstack_copy_attr_all(dentry->d_inode, lower_inode);
- 	}
- out:
- 	return rc;
-diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
-index 5a71918..89e8560 100644
---- a/fs/ecryptfs/inode.c
-+++ b/fs/ecryptfs/inode.c
-@@ -576,9 +576,9 @@ ecryptfs_rename(struct inode *old_dir, struct dentry *old_dentry,
- 			lower_new_dir_dentry->d_inode, lower_new_dentry);
- 	if (rc)
- 		goto out_lock;
--	fsstack_copy_attr_all(new_dir, lower_new_dir_dentry->d_inode, NULL);
-+	fsstack_copy_attr_all(new_dir, lower_new_dir_dentry->d_inode);
- 	if (new_dir != old_dir)
--		fsstack_copy_attr_all(old_dir, lower_old_dir_dentry->d_inode, NULL);
-+		fsstack_copy_attr_all(old_dir, lower_old_dir_dentry->d_inode);
- out_lock:
- 	unlock_rename(lower_old_dir_dentry, lower_new_dir_dentry);
- 	dput(lower_new_dentry->d_parent);
-@@ -912,7 +912,7 @@ static int ecryptfs_setattr(struct dentry *dentry, struct iattr *ia)
- 
- 	rc = notify_change(lower_dentry, ia);
- out:
--	fsstack_copy_attr_all(inode, lower_inode, NULL);
-+	fsstack_copy_attr_all(inode, lower_inode);
- 	return rc;
- }
- 
-diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
-index e5580bc..6276cdf 100644
---- a/fs/ecryptfs/main.c
-+++ b/fs/ecryptfs/main.c
-@@ -211,7 +211,7 @@ int ecryptfs_interpose(struct dentry *lower_dentry, struct dentry *dentry,
- 		d_add(dentry, inode);
- 	else
- 		d_instantiate(dentry, inode);
--	fsstack_copy_attr_all(inode, lower_inode, NULL);
-+	fsstack_copy_attr_all(inode, lower_inode);
- 	/* This size will be overwritten for real files w/ headers and
- 	 * other metadata */
- 	fsstack_copy_inode_size(inode, lower_inode);
+ obj-$(CONFIG_VXFS_FS)		+= freevxfs/
+ obj-$(CONFIG_NFS_FS)		+= nfs/
+ obj-$(CONFIG_EXPORTFS)		+= exportfs/
 diff --git a/fs/namei.c b/fs/namei.c
-index 3b993db..14f9861 100644
+index a4855af..948c5e5 100644
 --- a/fs/namei.c
 +++ b/fs/namei.c
-@@ -389,6 +389,7 @@ void release_open_intent(struct nameidata *nd)
+@@ -387,6 +387,7 @@ void release_open_intent(struct nameidata *nd)
  	else
  		fput(nd->intent.open.file);
  }
-+EXPORT_SYMBOL(release_open_intent);
++EXPORT_SYMBOL_GPL(release_open_intent);
  
  static inline struct dentry *
  do_revalidate(struct dentry *dentry, struct nameidata *nd)
+diff --git a/fs/splice.c b/fs/splice.c
+index 3920866..488e3ba 100644
+--- a/fs/splice.c
++++ b/fs/splice.c
+@@ -1053,8 +1053,8 @@ EXPORT_SYMBOL(generic_splice_sendpage);
+ /*
+  * Attempt to initiate a splice from pipe to file.
+  */
+-static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
+-			   loff_t *ppos, size_t len, unsigned int flags)
++long vfs_splice_from(struct pipe_inode_info *pipe, struct file *out,
++		     loff_t *ppos, size_t len, unsigned int flags)
+ {
+ 	ssize_t (*splice_write)(struct pipe_inode_info *, struct file *,
+ 				loff_t *, size_t, unsigned int);
+@@ -1077,13 +1077,14 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
+ 
+ 	return splice_write(pipe, out, ppos, len, flags);
+ }
++EXPORT_SYMBOL_GPL(vfs_splice_from);
+ 
+ /*
+  * Attempt to initiate a splice from a file to a pipe.
+  */
+-static long do_splice_to(struct file *in, loff_t *ppos,
+-			 struct pipe_inode_info *pipe, size_t len,
+-			 unsigned int flags)
++long vfs_splice_to(struct file *in, loff_t *ppos,
++		   struct pipe_inode_info *pipe, size_t len,
++		   unsigned int flags)
+ {
+ 	ssize_t (*splice_read)(struct file *, loff_t *,
+ 			       struct pipe_inode_info *, size_t, unsigned int);
+@@ -1103,6 +1104,7 @@ static long do_splice_to(struct file *in, loff_t *ppos,
+ 
+ 	return splice_read(in, ppos, pipe, len, flags);
+ }
++EXPORT_SYMBOL_GPL(vfs_splice_to);
+ 
+ /**
+  * splice_direct_to_actor - splices data directly between two non-pipes
+@@ -1172,7 +1174,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;
+ 
+-		ret = do_splice_to(in, &pos, pipe, len, flags);
++		ret = vfs_splice_to(in, &pos, pipe, len, flags);
+ 		if (unlikely(ret <= 0))
+ 			goto out_release;
+ 
+@@ -1231,7 +1233,7 @@ static int direct_splice_actor(struct pipe_inode_info *pipe,
+ {
+ 	struct file *file = sd->u.file;
+ 
+-	return do_splice_from(pipe, file, &sd->pos, sd->total_len, sd->flags);
++	return vfs_splice_from(pipe, file, &sd->pos, sd->total_len, sd->flags);
+ }
+ 
+ /**
+@@ -1329,7 +1331,7 @@ static long do_splice(struct file *in, loff_t __user *off_in,
+ 		} else
+ 			off = &out->f_pos;
+ 
+-		ret = do_splice_from(ipipe, out, off, len, flags);
++		ret = vfs_splice_from(ipipe, out, off, len, flags);
+ 
+ 		if (off_out && copy_to_user(off_out, off, sizeof(loff_t)))
+ 			ret = -EFAULT;
+@@ -1350,7 +1352,7 @@ static long do_splice(struct file *in, loff_t __user *off_in,
+ 		} else
+ 			off = &in->f_pos;
+ 
+-		ret = do_splice_to(in, off, opipe, len, flags);
++		ret = vfs_splice_to(in, off, opipe, len, flags);
+ 
+ 		if (off_in && copy_to_user(off_in, off, sizeof(loff_t)))
+ 			ret = -EFAULT;
 diff --git a/fs/stack.c b/fs/stack.c
-index 67716f6..4336f2b 100644
+index 4a6f7f4..7eeef12 100644
 --- a/fs/stack.c
 +++ b/fs/stack.c
-@@ -1,24 +1,42 @@
+@@ -1,8 +1,20 @@
 +/*
-+ * Copyright (c) 2006-2007 Erez Zadok
++ * Copyright (c) 2006-2009 Erez Zadok
 + * Copyright (c) 2006-2007 Josef 'Jeff' Sipek
-+ * Copyright (c) 2006-2007 Stony Brook University
-+ * Copyright (c) 2006-2007 The Research Foundation of SUNY
++ * Copyright (c) 2006-2009 Stony Brook University
++ * Copyright (c) 2006-2009 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
@@ -646,55 +689,55 @@
   *
   * This function cannot be inlined since i_size_{read,write} is rather
   * heavy-weight on 32-bit systems
-  */
- void fsstack_copy_inode_size(struct inode *dst, const struct inode *src)
- {
--	i_size_write(dst, i_size_read((struct inode *)src));
-+#if BITS_PER_LONG == 32 && defined(CONFIG_SMP)
-+	spin_lock(&dst->i_lock);
-+#endif
-+	i_size_write(dst, i_size_read(src));
- 	dst->i_blocks = src->i_blocks;
-+#if BITS_PER_LONG == 32 && defined(CONFIG_SMP)
-+	spin_unlock(&dst->i_lock);
-+#endif
- }
- EXPORT_SYMBOL_GPL(fsstack_copy_inode_size);
- 
--/* copy all attributes; get_nlinks is optional way to override the i_nlink
-+/*
-+ * copy all attributes; get_nlinks is optional way to override the i_nlink
-  * copying
-  */
--void fsstack_copy_attr_all(struct inode *dest, const struct inode *src,
--				int (*get_nlinks)(struct inode *))
-+void fsstack_copy_attr_all(struct inode *dest, const struct inode *src)
- {
- 	dest->i_mode = src->i_mode;
- 	dest->i_uid = src->i_uid;
-@@ -29,14 +47,6 @@ void fsstack_copy_attr_all(struct inode *dest, const struct inode *src,
- 	dest->i_ctime = src->i_ctime;
- 	dest->i_blkbits = src->i_blkbits;
- 	dest->i_flags = src->i_flags;
--
--	/*
--	 * Update the nlinks AFTER updating the above fields, because the
--	 * get_links callback may depend on them.
--	 */
--	if (!get_nlinks)
--		dest->i_nlink = src->i_nlink;
--	else
--		dest->i_nlink = (*get_nlinks)(dest);
-+	dest->i_nlink = src->i_nlink;
- }
- EXPORT_SYMBOL_GPL(fsstack_copy_attr_all);
+diff --git a/fs/super.c b/fs/super.c
+index aff046b..ad6dc74 100644
+--- a/fs/super.c
++++ b/fs/super.c
+@@ -95,6 +95,7 @@ static struct super_block *alloc_super(struct file_system_type *type)
+ 		s->s_count = S_BIAS;
+ 		atomic_set(&s->s_active, 1);
+ 		mutex_init(&s->s_vfs_rename_mutex);
++		lockdep_set_class(&s->s_vfs_rename_mutex, &type->s_vfs_rename_key);
+ 		mutex_init(&s->s_dquot.dqio_mutex);
+ 		mutex_init(&s->s_dquot.dqonoff_mutex);
+ 		init_rwsem(&s->s_dquot.dqptr_sem);
+diff --git a/fs/unionfs/Kconfig b/fs/unionfs/Kconfig
+new file mode 100644
+index 0000000..f3c1ac4
+--- /dev/null
++++ b/fs/unionfs/Kconfig
+@@ -0,0 +1,24 @@
++config UNION_FS
++	tristate "Union file system (EXPERIMENTAL)"
++	depends on EXPERIMENTAL
++	help
++	  Unionfs is a stackable unification file system, which appears to
++	  merge the contents of several directories (branches), while keeping
++	  their physical content separate.
++
++	  See <http://unionfs.filesystems.org> for details
++
++config UNION_FS_XATTR
++	bool "Unionfs extended attributes"
++	depends on UNION_FS
++	help
++	  Extended attributes are name:value pairs associated with inodes by
++	  the kernel or by users (see the attr(5) manual page).
++
++	  If unsure, say N.
++
++config UNION_FS_DEBUG
++	bool "Debug Unionfs"
++	depends on UNION_FS
++	help
++	  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..aa6aa7f
+index 0000000..1db51b0
 --- /dev/null
 +++ b/fs/unionfs/Makefile
 @@ -0,0 +1,17 @@
-+UNIONFS_VERSION="2.2.2 (for 2.6.24-rc7)"
++UNIONFS_VERSION="2.5.4 (for 2.6.34-rc0)"
 +
 +EXTRA_CFLAGS += -DUNIONFS_VERSION=\"$(UNIONFS_VERSION)\"
 +
@@ -702,7 +745,7 @@
 +
 +unionfs-y := subr.o dentry.o file.o inode.o main.o super.o \
 +	rdstate.o copyup.o dirhelper.o rename.o unlink.o \
-+	lookup.o commonfops.o dirfops.o sioq.o mmap.o
++	lookup.o commonfops.o dirfops.o sioq.o mmap.o whiteout.o
 +
 +unionfs-$(CONFIG_UNION_FS_XATTR) += xattr.o
 +
@@ -713,12 +756,12 @@
 +endif
 diff --git a/fs/unionfs/commonfops.c b/fs/unionfs/commonfops.c
 new file mode 100644
-index 0000000..f37192f
+index 0000000..740c4ad
 --- /dev/null
 +++ b/fs/unionfs/commonfops.c
-@@ -0,0 +1,835 @@
+@@ -0,0 +1,896 @@
 +/*
-+ * Copyright (c) 2003-2007 Erez Zadok
++ * Copyright (c) 2003-2010 Erez Zadok
 + * Copyright (c) 2003-2006 Charles P. Wright
 + * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
 + * Copyright (c) 2005-2006 Junjiro Okajima
@@ -727,8 +770,8 @@
 + * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
 + * Copyright (c) 2003      Puja Gupta
 + * Copyright (c) 2003      Harikesavan Krishnan
-+ * Copyright (c) 2003-2007 Stony Brook University
-+ * Copyright (c) 2003-2007 The Research Foundation of SUNY
++ * Copyright (c) 2003-2010 Stony Brook University
++ * Copyright (c) 2003-2010 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
@@ -743,7 +786,7 @@
 + * stolen from NFS's silly rename
 + */
 +static int copyup_deleted_file(struct file *file, struct dentry *dentry,
-+			       int bstart, int bindex)
++			       struct dentry *parent, int bstart, int bindex)
 +{
 +	static unsigned int counter;
 +	const int i_inosize = sizeof(dentry->d_inode->i_ino) * 2;
@@ -781,7 +824,7 @@
 +		pr_debug("unionfs: trying to rename %s to %s\n",
 +			 dentry->d_name.name, name);
 +
-+		tmp_dentry = lookup_one_len(name, lower_dentry->d_parent,
++		tmp_dentry = lookup_lck_len(name, lower_dentry->d_parent,
 +					    nlen);
 +		if (IS_ERR(tmp_dentry)) {
 +			err = PTR_ERR(tmp_dentry);
@@ -790,8 +833,7 @@
 +	} while (tmp_dentry->d_inode != NULL);	/* need negative dentry */
 +	dput(tmp_dentry);
 +
-+	err = copyup_named_file(dentry->d_parent->d_inode, file, name, bstart,
-+				bindex,
++	err = copyup_named_file(parent->d_inode, file, name, bstart, bindex,
 +				i_size_read(file->f_path.dentry->d_inode));
 +	if (err) {
 +		if (unlikely(err == -EEXIST))
@@ -898,8 +940,9 @@
 +		lower_file =
 +			dentry_open(lower_dentry,
 +				    unionfs_lower_mnt_idx(dentry, bindex),
-+				    file->f_flags);
++				    file->f_flags, current_cred());
 +		if (IS_ERR(lower_file)) {
++			branchput(sb, bindex);
 +			err = PTR_ERR(lower_file);
 +			goto out;
 +		} else {
@@ -917,7 +960,8 @@
 +	struct file *lower_file;
 +	struct dentry *lower_dentry;
 +	struct dentry *dentry = file->f_path.dentry;
-+	struct inode *parent_inode = dentry->d_parent->d_inode;
++	struct dentry *parent = dget_parent(dentry);
++	struct inode *parent_inode = parent->d_inode;
 +	struct super_block *sb = dentry->d_sb;
<<Diff was trimmed, longer than 597 lines>>

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



More information about the pld-cvs-commit mailing list