SOURCES: kernel-desktop-unionfs.patch - cp from linux-2.6-unionfs-...

glen glen at pld-linux.org
Wed Apr 9 00:19:14 CEST 2008


Author: glen                         Date: Tue Apr  8 22:19:14 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- cp from linux-2.6-unionfs-2.2.2.patch r1.1.2.1

---- Files affected:
SOURCES:
   kernel-desktop-unionfs.patch (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SOURCES/kernel-desktop-unionfs.patch
diff -u SOURCES/kernel-desktop-unionfs.patch:1.1 SOURCES/kernel-desktop-unionfs.patch:1.2
--- SOURCES/kernel-desktop-unionfs.patch:1.1	Thu Aug 23 14:10:35 2007
+++ SOURCES/kernel-desktop-unionfs.patch	Wed Apr  9 00:19:09 2008
@@ -1,8 +1,8 @@
 diff --git a/Documentation/filesystems/00-INDEX b/Documentation/filesystems/00-INDEX
-index 5717858..2ef035e 100644
+index 1de155e..b168331 100644
 --- a/Documentation/filesystems/00-INDEX
 +++ b/Documentation/filesystems/00-INDEX
-@@ -84,6 +84,8 @@ udf.txt
+@@ -96,6 +96,8 @@ udf.txt
  	- info and mount options for the UDF filesystem.
  ufs.txt
  	- info on the ufs filesystem.
@@ -29,11 +29,11 @@
 +	- Usage information and examples.
 diff --git a/Documentation/filesystems/unionfs/concepts.txt b/Documentation/filesystems/unionfs/concepts.txt
 new file mode 100644
-index 0000000..eb74aac
+index 0000000..bed69bd
 --- /dev/null
 +++ b/Documentation/filesystems/unionfs/concepts.txt
-@@ -0,0 +1,181 @@
-+Unionfs 2.0 CONCEPTS:
+@@ -0,0 +1,213 @@
++Unionfs 2.x CONCEPTS:
 +=====================
 +
 +This file describes the concepts needed by a namespace unification file
@@ -101,12 +101,26 @@
 +=======
 +
 +When a change is made to the contents of a file's data or meta-data, they
-+have to be stored somewhere. The best way is to create a copy of the
++have to be stored somewhere.  The best way is to create a copy of the
 +original file on a branch that is writable, and then redirect the write
-+though to this copy. The copy must be made on a higher priority branch so
++though to this copy.  The copy must be made on a higher priority branch so
 +that lookup and readdir return this newer "version" of the file rather than
 +the original (see duplicate elimination).
 +
++An entire unionfs mount can be read-only or read-write.  If it's read-only,
++then none of the branches will be written to, even if some of the branches
++are physically writeable.  If the unionfs mount is read-write, then the
++leftmost (highest priority) branch must be writeable (for copyup to take
++place); the remaining branches can be any mix of read-write and read-only.
++
++In a writeable mount, unionfs will create new files/dir in the leftmost
++branch.  If one tries to modify a file in a read-only branch/media, unionfs
++will copyup the file to the leftmost branch and modify it there.  If you try
++to modify a file from a writeable branch which is not the leftmost branch,
++then unionfs will modify it in that branch; this is useful if you, say,
++unify differnet packages (e.g., apache, sendmail, ftpd, etc.) and you want
++changes to specific package files to remain logically in the directory where
++they came from.
 +
 +Cache Coherency:
 +================
@@ -127,7 +141,7 @@
 +The way Unionfs ensures cache coherency is as follows.  At each entry point
 +to a Unionfs file system method, we call a utility function to validate the
 +primary objects of this method.  Generally, we call unionfs_file_revalidate
-+on open files, and __Unionfs_d_revalidate_chain on dentries (which also
++on open files, and __unionfs_d_revalidate_chain on dentries (which also
 +validates inodes).  These utility functions check to see whether the upper
 +Unionfs object is in sync with any of the lower objects that it represents.
 +The checks we perform include whether the Unionfs superblock has a newer
@@ -139,7 +153,7 @@
 +similarly to how we do so for branch-management.
 +
 +While rebuilding Unionfs's objects, we also purge any page mappings and
-+truncate inode pages (see fs/Unionfs/dentry.c:purge_inode_data).  This is to
++truncate inode pages (see fs/unionfs/dentry.c:purge_inode_data).  This is to
 +ensure that Unionfs will re-get the newer data from the lower branches.  We
 +perform this purging only if the Unionfs operation in question is a reading
 +operation; if Unionfs is performing a data writing operation (e.g., ->write,
@@ -212,15 +226,33 @@
 +->file_revalidate (similarly to dentry->d_revalidate) that will be called
 +before each VFS op that has a "struct file" in it.
 +
++Certain file systems have micro-second granularity (or better) for inode
++times, and asynchronous actions could cause those times to change with some
++small delay.  In such cases, Unionfs may see a changed inode time that only
++differs by a tiny fraction of a second: such a change may be a false
++positive indication that the lower object has changed, whereas if unionfs
++waits a little longer, that false indication will not be seen.  (These false
++positives are harmless, because they would at most cause unionfs to
++re-validate an object that may need no revalidation, and print a debugging
++message that clutters the console/logs.)  Therefore, to minimize the chances
++of these situations, we delay the detection of changed times by a small
++factor of a few seconds, called UNIONFS_MIN_CC_TIME (which defaults to 3
++seconds, as does NFS).  This means that we will detect the change, only a
++couple of seconds later, if indeed the time change persists in the lower
++file object.  This delayed detection has an added performance benefit: we
++reduce the number of times that unionfs has to revalidate objects, in case
++there's a lot of concurrent activity on both the upper and lower objects,
++for the same file(s).  Lastly, this delayed time attribute detection is
++similar to how NFS clients operate (e.g., acregmin).
 +
 +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
-index 0000000..6101ebf
+index 0000000..f4b7e7e
 --- /dev/null
 +++ b/Documentation/filesystems/unionfs/issues.txt
-@@ -0,0 +1,12 @@
-+KNOWN Unionfs 2.1 ISSUES:
+@@ -0,0 +1,28 @@
++KNOWN Unionfs 2.x ISSUES:
 +=========================
 +
 +1. Unionfs should not use lookup_one_len() on the underlying f/s as it
@@ -230,6 +262,22 @@
 +   currently introducing VFS changes to fs/namei.c's do_path_lookup() to
 +   allow proper file lookup and opening in stackable file systems.
 +
++2. Lockdep (a debugging feature) isn't aware of stacking, and so it
++   incorrectly complains about locking problems.  The problem boils down to
++   this: Lockdep considers all objects of a certain type to be in the same
++   class, for example, all inodes.  Lockdep doesn't like to see a lock held
++   on two inodes within the same task, and warns that it could lead to a
++   deadlock.  However, stackable file systems do precisely that: they lock
++   an upper object, and then a lower object, in a strict order to avoid
++   locking problems; in addition, Unionfs, as a fan-out file system, may
++   have to lock several lower inodes.  We are currently looking into Lockdep
++   to see how to make it aware of stackable file systems.  For now, we
++   temporarily disable lockdep when calling vfs methods on lower objects,
++   but only for those places where lockdep complained.  While this solution
++   may seem unclean, it is not without precedent: other places in the kernel
++   also do similar temporary disabling, of course after carefully having
++   checked that it is the right thing to do.  Anyway, you get any warnings
++   from Lockdep, please report them to the Unionfs maintainers.
 +
 +For more information, see <http://unionfs.filesystems.org/>.
 diff --git a/Documentation/filesystems/unionfs/rename.txt b/Documentation/filesystems/unionfs/rename.txt
@@ -271,10 +319,10 @@
 +
 diff --git a/Documentation/filesystems/unionfs/usage.txt b/Documentation/filesystems/unionfs/usage.txt
 new file mode 100644
-index 0000000..2316670
+index 0000000..1adde69
 --- /dev/null
 +++ b/Documentation/filesystems/unionfs/usage.txt
-@@ -0,0 +1,97 @@
+@@ -0,0 +1,134 @@
 +Unionfs is a stackable unification file system, which can appear to merge
 +the contents of several directories (branches), while keeping their physical
 +content separate.  Unionfs is useful for unified source tree management,
@@ -284,17 +332,35 @@
 +in the fan-out.  To maintain Unix semantics, Unionfs handles elimination of
 +duplicates, partial-error conditions, and more.
 +
-+# mount -t unionfs -o branch-option[,union-options[,...]] none MOUNTPOINT
++GENERAL SYNTAX
++==============
 +
-+The available branch-option for the mount command is:
++# mount -t unionfs -o <OPTIONS>,<BRANCH-OPTIONS> none MOUNTPOINT
++
++OPTIONS can be any legal combination of:
++
++- ro		# mount file system read-only
++- rw		# mount file system read-write
++- remount	# remount the file system (see Branch Management below)
++- incgen	# increment generation no. (see Cache Consistency below)
++
++BRANCH-OPTIONS can be either (1) a list of branches given to the "dirs="
++option, or (2) a list of individual branch manipulation commands, combined
++with the "remount" option, and is further described in the "Branch
++Management" section below.
++
++The syntax for the "dirs=" mount option is:
 +
 +	dirs=branch[=ro|=rw][:...]
 +
-+specifies a separated list of which directories compose the union.
-+Directories that come earlier in the list have a higher precedence than
-+those which come later. Additionally, read-only or read-write permissions of
-+the branch can be specified by appending =ro or =rw (default) to each
-+directory.
++The "dirs=" option takes a colon-delimited list of directories to compose
++the union, with an optional branch mode for each of those directories.
++Directories that come earlier (specified first, on the left) in the list
++have a higher precedence than those which come later.  Additionally,
++read-only or read-write permissions of the branch can be specified by
++appending =ro or =rw (default) to each directory.  See the Copyup section in
++concepts.txt, for a description of Unionfs's behavior when mixing read-only
++and read-write branches and mounts.
 +
 +Syntax:
 +
@@ -305,11 +371,12 @@
 +	dirs=/writable_branch=rw:/read-only_branch=ro
 +
 +
-+DYNAMIC BRANCH MANAGEMENT AND REMOUNTS
-+======================================
++BRANCH MANAGEMENT
++=================
 +
-+You can remount a union and change its overall mode, or reconfigure the
-+branches, as follows.
++Once you mount your union for the first time, using the "dirs=" option, you
++can then change the union's overall mode or reconfigure the branches, using
++the remount option, as follows.
 +
 +To downgrade a union from read-write to read-only:
 +
@@ -351,12 +418,29 @@
 +
 +# mount -t unionfs -o remount,mode=/foo=rw,mode=/bar=ro none MOUNTPOINT
 +
++Note: in Unionfs 2.x, you cannot set the leftmost branch to readonly because
++then Unionfs won't have any writable place for copyups to take place.
++Moreover, the VFS can get confused when it tries to modify something in a
++file system mounted read-write, but isn't permitted to write to it.
++Instead, you should set the whole union as readonly, as described above.
++If, however, you must set the leftmost branch as readonly, perhaps so you
++can get a snapshot of it at a point in time, then you should insert a new
++writable top-level branch, and mark the one you want as readonly.  This can
++be accomplished as follows, assuming that /foo is your current leftmost
++branch:
++
++# mount -t tmpfs -o size=NNN /new
++# mount -t unionfs -o remount,add=/new,mode=/foo=ro none MOUNTPOINT
++<do what you want safely in /foo>
++# mount -t unionfs -o remount,del=/new,mode=/foo=rw none MOUNTPOINT
++<check if there's anything in /new you want to preserve>
++# umount /new
 +
 +CACHE CONSISTENCY
 +=================
 +
 +If you modify any file on any of the lower branches directly, while there is
-+a Unionfs 2.0 mounted above any of those branches, you should tell Unionfs
++a Unionfs 2.x mounted above any of those branches, you should tell Unionfs
 +to purge its caches and re-get the objects.  To do that, you have to
 +increment the generation number of the superblock using the following
 +command:
@@ -364,19 +448,20 @@
 +# mount -t unionfs -o remount,incgen none MOUNTPOINT
 +
 +Note that the older way of incrementing the generation number using an
-+ioctl, is no longer supported in Unionfs 2.0.  Ioctls in general are not
-+encouraged.  Plus, an ioctl is per-file concept, whereas the generation
-+number is a per-file-system concept.  Worse, such an ioctl requires an open
-+file, which then has to be invalidated by the very nature of the generation
-+number increase (read: the old generation increase ioctl was pretty racy).
++ioctl, is no longer supported in Unionfs 2.0 and newer.  Ioctls in general
++are not encouraged.  Plus, an ioctl is per-file concept, whereas the
++generation number is a per-file-system concept.  Worse, such an ioctl
++requires an open file, which then has to be invalidated by the very nature
++of the generation number increase (read: the old generation increase ioctl
++was pretty racy).
 +
 +
 +For more information, see <http://unionfs.filesystems.org/>.
 diff --git a/MAINTAINERS b/MAINTAINERS
-index df40a4e..161652b 100644
+index b4f611c..d68b687 100644
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -3593,6 +3593,15 @@ L:	linux-kernel at vger.kernel.org
+@@ -3804,6 +3804,15 @@ L:	linux-kernel at vger.kernel.org
  W:	http://www.kernel.dk
  S:	Maintained
  
@@ -392,21 +477,11 @@
  USB ACM DRIVER
  P:	Oliver Neukum
  M:	oliver at neukum.name
-diff --git a/drivers/mtd/mtdsuper.c b/drivers/mtd/mtdsuper.c
-index aca3319..e28f0fa 100644
---- a/drivers/mtd/mtdsuper.c
-+++ b/drivers/mtd/mtdsuper.c
-@@ -230,3 +230,5 @@ void kill_mtd_super(struct super_block *sb)
- }
- 
- EXPORT_SYMBOL_GPL(kill_mtd_super);
-+
-+MODULE_LICENSE("GPL");
 diff --git a/fs/Kconfig b/fs/Kconfig
-index 0fa0c11..e9380c7 100644
+index 487236c..55a78b7 100644
 --- a/fs/Kconfig
 +++ b/fs/Kconfig
-@@ -1030,6 +1030,47 @@ config CONFIGFS_FS
+@@ -1041,6 +1041,47 @@ config CONFIGFS_FS
  
  endmenu
  
@@ -417,7 +492,7 @@
 +	depends on EXPERIMENTAL && KEYS && CRYPTO && NET
 +	help
 +	  Encrypted filesystem that operates on the VFS layer.  See
-+	  <file:Documentation/ecryptfs.txt> to learn more about
++	  <file:Documentation/filesystems/ecryptfs.txt> to learn more about
 +	  eCryptfs.  Userspace components are required and can be
 +	  obtained from <http://ecryptfs.sf.net>.
 +
@@ -454,7 +529,7 @@
  menu "Miscellaneous filesystems"
  
  config ADFS_FS
-@@ -1082,18 +1123,6 @@ config AFFS_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.
  
@@ -463,7 +538,7 @@
 -	depends on EXPERIMENTAL && KEYS && CRYPTO && NET
 -	help
 -	  Encrypted filesystem that operates on the VFS layer.  See
--	  <file:Documentation/ecryptfs.txt> to learn more about
+-	  <file:Documentation/filesystems/ecryptfs.txt> to learn more about
 -	  eCryptfs.  Userspace components are required and can be
 -	  obtained from <http://ecryptfs.sf.net>.
 -
@@ -474,7 +549,7 @@
  	tristate "Apple Macintosh file system support (EXPERIMENTAL)"
  	depends on BLOCK && EXPERIMENTAL
 diff --git a/fs/Makefile b/fs/Makefile
-index 720c29d..951f411 100644
+index 500cf15..e202288 100644
 --- a/fs/Makefile
 +++ b/fs/Makefile
 @@ -118,3 +118,4 @@ obj-$(CONFIG_HPPFS)		+= hppfs/
@@ -482,35 +557,6 @@
  obj-$(CONFIG_OCFS2_FS)		+= ocfs2/
  obj-$(CONFIG_GFS2_FS)           += gfs2/
 +obj-$(CONFIG_UNION_FS)		+= unionfs/
-diff --git a/fs/drop_caches.c b/fs/drop_caches.c
-index 03ea769..6a7aa05 100644
---- a/fs/drop_caches.c
-+++ b/fs/drop_caches.c
-@@ -3,6 +3,7 @@
-  */
- 
- #include <linux/kernel.h>
-+#include <linux/module.h>
- #include <linux/mm.h>
- #include <linux/fs.h>
- #include <linux/writeback.h>
-@@ -12,7 +13,7 @@
- /* A global variable is a bit ugly, but it keeps the code simple */
- int sysctl_drop_caches;
- 
--static void drop_pagecache_sb(struct super_block *sb)
-+void drop_pagecache_sb(struct super_block *sb)
- {
- 	struct inode *inode;
- 
-@@ -24,6 +25,7 @@ static void drop_pagecache_sb(struct super_block *sb)
- 	}
- 	spin_unlock(&inode_lock);
- }
-+EXPORT_SYMBOL(drop_pagecache_sb);
- 
- void drop_pagecache(void)
- {
 diff --git a/fs/ecryptfs/dentry.c b/fs/ecryptfs/dentry.c
 index cb20b96..a8c1686 100644
 --- a/fs/ecryptfs/dentry.c
@@ -525,36 +571,10 @@
  out:
  	return rc;
 diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
-index 9c6877c..fed495d 100644
+index 5a71918..89e8560 100644
 --- a/fs/ecryptfs/inode.c
 +++ b/fs/ecryptfs/inode.c
-@@ -280,7 +280,9 @@ static struct dentry *ecryptfs_lookup(struct inode *dir, struct dentry *dentry,
- 	int rc = 0;
- 	struct dentry *lower_dir_dentry;
- 	struct dentry *lower_dentry;
-+	struct dentry *dentry_save;
- 	struct vfsmount *lower_mnt;
-+	struct vfsmount *mnt_save;
- 	char *encoded_name;
- 	unsigned int encoded_namelen;
- 	struct ecryptfs_crypt_stat *crypt_stat = NULL;
-@@ -308,9 +310,13 @@ static struct dentry *ecryptfs_lookup(struct inode *dir, struct dentry *dentry,
- 	}
- 	ecryptfs_printk(KERN_DEBUG, "encoded_name = [%s]; encoded_namelen "
- 			"= [%d]\n", encoded_name, encoded_namelen);
--	lower_dentry = lookup_one_len(encoded_name, lower_dir_dentry,
--				      encoded_namelen - 1);
-+	dentry_save = nd->dentry;
-+	mnt_save = nd->mnt;
-+	lower_dentry = lookup_one_len_nd(encoded_name, lower_dir_dentry,
-+					 (encoded_namelen - 1), nd);
- 	kfree(encoded_name);
-+	nd->mnt = mnt_save;
-+	nd->dentry = dentry_save;
- 	if (IS_ERR(lower_dentry)) {
- 		ecryptfs_printk(KERN_ERR, "ERR from lower_dentry\n");
- 		rc = PTR_ERR(lower_dentry);
-@@ -597,9 +603,9 @@ ecryptfs_rename(struct inode *old_dir, struct dentry *old_dentry,
+@@ -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;
@@ -566,8 +586,8 @@
  out_lock:
  	unlock_rename(lower_old_dir_dentry, lower_new_dir_dentry);
  	dput(lower_new_dentry->d_parent);
-@@ -957,7 +963,7 @@ static int ecryptfs_setattr(struct dentry *dentry, struct iattr *ia)
- 	}
+@@ -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);
@@ -576,10 +596,10 @@
  }
  
 diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
-index 606128f..5f99404 100644
+index e5580bc..6276cdf 100644
 --- a/fs/ecryptfs/main.c
 +++ b/fs/ecryptfs/main.c
-@@ -151,7 +151,7 @@ int ecryptfs_interpose(struct dentry *lower_dentry, struct dentry *dentry,
+@@ -211,7 +211,7 @@ int ecryptfs_interpose(struct dentry *lower_dentry, struct dentry *dentry,
  		d_add(dentry, inode);
  	else
  		d_instantiate(dentry, inode);
@@ -589,53 +609,22 @@
  	 * other metadata */
  	fsstack_copy_inode_size(inode, lower_inode);
 diff --git a/fs/namei.c b/fs/namei.c
-index 5e2d98d..90d2a3a 100644
+index 3b993db..14f9861 100644
 --- a/fs/namei.c
 +++ b/fs/namei.c
-@@ -1124,6 +1124,10 @@ static int fastcall do_path_lookup(int dfd, const char *name,
- 		nd->mnt = mntget(fs->rootmnt);
- 		nd->dentry = dget(fs->root);
- 		read_unlock(&fs->lock);
-+	} else if (flags & LOOKUP_ONE) {
-+		/* nd->mnt and nd->dentry already set, just grab references */
-+		mntget(nd->mnt);
-+		dget(nd->dentry);
- 	} else if (dfd == AT_FDCWD) {
- 		read_lock(&fs->lock);
- 		nd->mnt = mntget(fs->pwdmnt);
-@@ -1325,7 +1329,8 @@ static inline int __lookup_one_len(const char *name, struct qstr *this, struct d
- 	return 0;
- }
- 
--struct dentry *lookup_one_len(const char *name, struct dentry *base, int len)
-+struct dentry *lookup_one_len_nd(const char *name, struct dentry *base, 
-+				 int len, struct nameidata *nd)
- {
- 	int err;
- 	struct qstr this;
-@@ -1333,7 +1338,7 @@ struct dentry *lookup_one_len(const char *name, struct dentry *base, int len)
- 	err = __lookup_one_len(name, &this, base, len);
- 	if (err)
- 		return ERR_PTR(err);
--	return __lookup_hash(&this, base, NULL);
-+	return __lookup_hash(&this, base, nd);
+@@ -389,6 +389,7 @@ void release_open_intent(struct nameidata *nd)
+ 	else
+ 		fput(nd->intent.open.file);
  }
++EXPORT_SYMBOL(release_open_intent);
  
- struct dentry *lookup_one_len_kern(const char *name, struct dentry *base, int len)
-@@ -2766,7 +2771,7 @@ EXPORT_SYMBOL(follow_up);
- 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);
+ static inline struct dentry *
+ do_revalidate(struct dentry *dentry, struct nameidata *nd)
 diff --git a/fs/stack.c b/fs/stack.c
-index 67716f6..a548aac 100644
+index 67716f6..4336f2b 100644
 --- a/fs/stack.c
 +++ b/fs/stack.c
-@@ -1,8 +1,20 @@
+@@ -1,24 +1,42 @@
 +/*
 + * Copyright (c) 2006-2007 Erez Zadok
 + * Copyright (c) 2006-2007 Josef 'Jeff' Sipek
@@ -657,7 +646,18 @@
   *
   * This function cannot be inlined since i_size_{read,write} is rather
   * heavy-weight on 32-bit systems
-@@ -14,11 +26,11 @@ void fsstack_copy_inode_size(struct inode *dst, const struct inode *src)
+  */
+ 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);
  
@@ -672,7 +672,7 @@
  {
  	dest->i_mode = src->i_mode;
  	dest->i_uid = src->i_uid;
-@@ -29,14 +41,6 @@ void fsstack_copy_attr_all(struct inode *dest, const struct inode *src,
+@@ -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;
@@ -690,11 +690,11 @@
  EXPORT_SYMBOL_GPL(fsstack_copy_attr_all);
 diff --git a/fs/unionfs/Makefile b/fs/unionfs/Makefile
 new file mode 100644
-index 0000000..c2444ce
+index 0000000..aa6aa7f
 --- /dev/null
 +++ b/fs/unionfs/Makefile
-@@ -0,0 +1,13 @@
-+UNIONFS_VERSION="2.1.2 (for 2.6.22.4)"
+@@ -0,0 +1,17 @@
++UNIONFS_VERSION="2.2.2 (for 2.6.24-rc7)"
 +
 +EXTRA_CFLAGS += -DUNIONFS_VERSION=\"$(UNIONFS_VERSION)\"
 +
@@ -707,12 +707,16 @@
 +unionfs-$(CONFIG_UNION_FS_XATTR) += xattr.o
 +
 +unionfs-$(CONFIG_UNION_FS_DEBUG) += debug.o
++
++ifeq ($(CONFIG_UNION_FS_DEBUG),y)
++EXTRA_CFLAGS += -DDEBUG
++endif
 diff --git a/fs/unionfs/commonfops.c b/fs/unionfs/commonfops.c
 new file mode 100644
-index 0000000..d77608e
+index 0000000..f37192f
 --- /dev/null
 +++ b/fs/unionfs/commonfops.c
-@@ -0,0 +1,837 @@
+@@ -0,0 +1,835 @@
 +/*
 + * Copyright (c) 2003-2007 Erez Zadok
 + * Copyright (c) 2003-2006 Charles P. Wright
@@ -774,8 +778,8 @@
 +		counter++;
 +		sprintf(suffix, "%*.*x", countersize, countersize, counter);
 +
-+		printk(KERN_DEBUG "unionfs: trying to rename %s to %s\n",
-+		       dentry->d_name.name, name);
++		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,
 +					    nlen);
@@ -783,14 +787,14 @@
 +			err = PTR_ERR(tmp_dentry);
 +			goto out;
 +		}
-+		/* don't dput here because of do-while condition eval order */
 +	} 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, file->f_path.dentry->d_inode->i_size);
++				bindex,
++				i_size_read(file->f_path.dentry->d_inode));
 +	if (err) {
-+		if (err == -EEXIST)
++		if (unlikely(err == -EEXIST))
 +			goto retry;
 +		goto out;
 +	}
@@ -842,7 +846,7 @@
 +		 */
 +		old_bid = UNIONFS_F(file)->saved_branch_ids[bindex];
 +		i = branch_id_to_idx(sb, old_bid);
-+		if (i < 0) {
++		if (unlikely(i < 0)) {
 +			printk(KERN_ERR "unionfs: no superblock for "
 +			       "file %p\n", file);
 +			continue;
@@ -898,15 +902,16 @@
 +		if (IS_ERR(lower_file)) {
 +			err = PTR_ERR(lower_file);
 +			goto out;
<<Diff was trimmed, longer than 597 lines>>

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



More information about the pld-cvs-commit mailing list