packages: kernel/kernel-aufs3.patch - updated from master

arekm arekm at pld-linux.org
Thu Jan 5 11:08:04 CET 2012


Author: arekm                        Date: Thu Jan  5 10:08:04 2012 GMT
Module: packages                      Tag: HEAD
---- Log message:
- updated from master

---- Files affected:
packages/kernel:
   kernel-aufs3.patch (1.4 -> 1.5) 

---- Diffs:

================================================================
Index: packages/kernel/kernel-aufs3.patch
diff -u packages/kernel/kernel-aufs3.patch:1.4 packages/kernel/kernel-aufs3.patch:1.5
--- packages/kernel/kernel-aufs3.patch:1.4	Mon Oct 24 20:54:05 2011
+++ packages/kernel/kernel-aufs3.patch	Thu Jan  5 11:07:59 2012
@@ -1,7 +1,7 @@
 aufs3.x-rcN kbuild patch
 
 diff --git a/fs/Kconfig b/fs/Kconfig
-index 9fe0b34..c4311f8 100644
+index 5f4c45d..357a8a6 100644
 --- a/fs/Kconfig
 +++ b/fs/Kconfig
 @@ -215,6 +215,7 @@ source "fs/pstore/Kconfig"
@@ -13,11 +13,11 @@
  endif # MISC_FILESYSTEMS
  
 diff --git a/fs/Makefile b/fs/Makefile
-index afc1096..5c5ac76 100644
+index d2c3353..680ad8a 100644
 --- a/fs/Makefile
 +++ b/fs/Makefile
 @@ -123,3 +123,4 @@ obj-$(CONFIG_GFS2_FS)           += gfs2/
- obj-$(CONFIG_EXOFS_FS)          += exofs/
+ obj-y				+= exofs/ # Multiple modules
  obj-$(CONFIG_CEPH_FS)		+= ceph/
  obj-$(CONFIG_PSTORE)		+= pstore/
 +obj-$(CONFIG_AUFS_FS)           += aufs/
@@ -36,10 +36,10 @@
 aufs3.x-rcN base patch
 
 diff --git a/fs/namei.c b/fs/namei.c
-index 0b3138d..8edad02 100644
+index 5008f01..4cc94cf 100644
 --- a/fs/namei.c
 +++ b/fs/namei.c
-@@ -1748,7 +1748,7 @@ static struct dentry *__lookup_hash(struct qstr *name,
+@@ -1753,7 +1753,7 @@ static struct dentry *__lookup_hash(struct qstr *name,
   * needs parent already locked. Doesn't follow mounts.
   * SMP-safe.
   */
@@ -77,10 +77,10 @@
  	ssize_t (*splice_read)(struct file *, loff_t *,
  			       struct pipe_inode_info *, size_t, unsigned int);
 diff --git a/include/linux/namei.h b/include/linux/namei.h
-index 409328d..40afdc0 100644
+index ffc0213..ef35a31 100644
 --- a/include/linux/namei.h
 +++ b/include/linux/namei.h
-@@ -84,6 +84,7 @@ extern int vfs_path_lookup(struct dentry *, struct vfsmount *,
+@@ -85,6 +85,7 @@ extern int vfs_path_lookup(struct dentry *, struct vfsmount *,
  extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry,
  		int (*open)(struct inode *, struct file *));
  
@@ -119,7 +119,7 @@
  
  /*
 diff --git a/fs/inode.c b/fs/inode.c
-index ec79246..46ac6f9 100644
+index ee4e66b..728042b 100644
 --- a/fs/inode.c
 +++ b/fs/inode.c
 @@ -65,6 +65,7 @@ static struct hlist_head *inode_hashtable __read_mostly;
@@ -131,10 +131,10 @@
  /*
   * Empty aops. Can be used for the cases where the user does not
 diff --git a/fs/namei.c b/fs/namei.c
-index 8edad02..50e8718 100644
+index 4cc94cf..af19e30 100644
 --- a/fs/namei.c
 +++ b/fs/namei.c
-@@ -1752,6 +1752,7 @@ struct dentry *lookup_hash(struct nameidata *nd)
+@@ -1757,6 +1757,7 @@ struct dentry *lookup_hash(struct nameidata *nd)
  {
  	return __lookup_hash(&nd->last, nd->path.dentry, nd);
  }
@@ -143,10 +143,10 @@
  /**
   * lookup_one_len - filesystem helper to lookup single pathname component
 diff --git a/fs/namespace.c b/fs/namespace.c
-index b4febb2..598a308 100644
+index 6d3a196..d832654 100644
 --- a/fs/namespace.c
 +++ b/fs/namespace.c
-@@ -1508,6 +1508,7 @@ int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg,
+@@ -1509,6 +1509,7 @@ int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg,
  	}
  	return 0;
  }
@@ -216,7 +216,7 @@
  static int fsnotify_mark_destroy(void *ignored)
  {
 diff --git a/fs/open.c b/fs/open.c
-index f711921..d742fc0 100644
+index 22c41b5..33b4033 100644
 --- a/fs/open.c
 +++ b/fs/open.c
 @@ -60,6 +60,7 @@ int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs,
@@ -248,10 +248,10 @@
  /**
   * splice_direct_to_actor - splices data directly between two non-pipes
 diff --git a/security/commoncap.c b/security/commoncap.c
-index a93b3b7..024282c 100644
+index ee4f848..611fd70 100644
 --- a/security/commoncap.c
 +++ b/security/commoncap.c
-@@ -971,3 +971,4 @@ int cap_file_mmap(struct file *file, unsigned long reqprot,
+@@ -975,3 +975,4 @@ int cap_file_mmap(struct file *file, unsigned long reqprot,
  	}
  	return ret;
  }
@@ -269,10 +269,10 @@
  int devcgroup_inode_mknod(int mode, dev_t dev)
  {
 diff --git a/security/security.c b/security/security.c
-index d9e1533..466ee5c 100644
+index 0c6cc69..d58ba1b 100644
 --- a/security/security.c
 +++ b/security/security.c
-@@ -373,6 +373,7 @@ int security_path_rmdir(struct path *dir, struct dentry *dentry)
+@@ -411,6 +411,7 @@ int security_path_rmdir(struct path *dir, struct dentry *dentry)
  		return 0;
  	return security_ops->path_rmdir(dir, dentry);
  }
@@ -280,7 +280,7 @@
  
  int security_path_unlink(struct path *dir, struct dentry *dentry)
  {
-@@ -389,6 +390,7 @@ int security_path_symlink(struct path *dir, struct dentry *dentry,
+@@ -427,6 +428,7 @@ int security_path_symlink(struct path *dir, struct dentry *dentry,
  		return 0;
  	return security_ops->path_symlink(dir, dentry, old_name);
  }
@@ -288,7 +288,7 @@
  
  int security_path_link(struct dentry *old_dentry, struct path *new_dir,
  		       struct dentry *new_dentry)
-@@ -397,6 +399,7 @@ int security_path_link(struct dentry *old_dentry, struct path *new_dir,
+@@ -435,6 +437,7 @@ int security_path_link(struct dentry *old_dentry, struct path *new_dir,
  		return 0;
  	return security_ops->path_link(old_dentry, new_dir, new_dentry);
  }
@@ -296,7 +296,7 @@
  
  int security_path_rename(struct path *old_dir, struct dentry *old_dentry,
  			 struct path *new_dir, struct dentry *new_dentry)
-@@ -415,6 +418,7 @@ int security_path_truncate(struct path *path)
+@@ -453,6 +456,7 @@ int security_path_truncate(struct path *path)
  		return 0;
  	return security_ops->path_truncate(path);
  }
@@ -304,7 +304,7 @@
  
  int security_path_chmod(struct dentry *dentry, struct vfsmount *mnt,
  			mode_t mode)
-@@ -423,6 +427,7 @@ int security_path_chmod(struct dentry *dentry, struct vfsmount *mnt,
+@@ -461,6 +465,7 @@ int security_path_chmod(struct dentry *dentry, struct vfsmount *mnt,
  		return 0;
  	return security_ops->path_chmod(dentry, mnt, mode);
  }
@@ -312,7 +312,7 @@
  
  int security_path_chown(struct path *path, uid_t uid, gid_t gid)
  {
-@@ -430,6 +435,7 @@ int security_path_chown(struct path *path, uid_t uid, gid_t gid)
+@@ -468,6 +473,7 @@ int security_path_chown(struct path *path, uid_t uid, gid_t gid)
  		return 0;
  	return security_ops->path_chown(path, uid, gid);
  }
@@ -320,7 +320,7 @@
  
  int security_path_chroot(struct path *path)
  {
-@@ -506,6 +512,7 @@ int security_inode_readlink(struct dentry *dentry)
+@@ -544,6 +550,7 @@ int security_inode_readlink(struct dentry *dentry)
  		return 0;
  	return security_ops->inode_readlink(dentry);
  }
@@ -328,7 +328,7 @@
  
  int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd)
  {
-@@ -520,6 +527,7 @@ int security_inode_permission(struct inode *inode, int mask)
+@@ -558,6 +565,7 @@ int security_inode_permission(struct inode *inode, int mask)
  		return 0;
  	return security_ops->inode_permission(inode, mask);
  }
@@ -336,7 +336,7 @@
  
  int security_inode_setattr(struct dentry *dentry, struct iattr *attr)
  {
-@@ -619,6 +627,7 @@ int security_file_permission(struct file *file, int mask)
+@@ -673,6 +681,7 @@ int security_file_permission(struct file *file, int mask)
  
  	return fsnotify_perm(file, mask);
  }
@@ -344,7 +344,7 @@
  
  int security_file_alloc(struct file *file)
  {
-@@ -646,6 +655,7 @@ int security_file_mmap(struct file *file, unsigned long reqprot,
+@@ -700,6 +709,7 @@ int security_file_mmap(struct file *file, unsigned long reqprot,
  		return ret;
  	return ima_file_mmap(file, prot);
  }
@@ -1400,8 +1400,8 @@
 +Otherwise from /new.
 diff -urN /usr/share/empty/Documentation/filesystems/aufs/README linux/Documentation/filesystems/aufs/README
 --- /usr/share/empty/Documentation/filesystems/aufs/README	1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/README	2011-10-24 20:51:51.580466925 +0200
-@@ -0,0 +1,313 @@
++++ linux/Documentation/filesystems/aufs/README	2012-01-05 11:00:59.215501779 +0100
+@@ -0,0 +1,328 @@
 +
 +Aufs3 -- advanced multi layered unification filesystem version 3.x
 +http://aufs.sf.net
@@ -1537,12 +1537,23 @@
 +$ cd aufs-util.git
 +$ git checkout origin/aufs3.0
 +
-+You may not be able to find the GIT branch in aufs-util for your
-+version. In this case, you should git-checkout the branch for the
++Note: The 3.x-rcN branch is to be used with `rc' kernel versions ONLY.
++The minor version number, 'x' in '3.x', of aufs may not always
++follow the minor version number of the kernel.
++Because changes in the kernel that cause the use of a new
++minor version number do not always require changes to aufs-util.
++
++Since aufs-util has its own minor version number, you may not be
++able to find a GIT branch in aufs-util for your kernel's
++exact minor version number.
++In this case, you should git-checkout the branch for the
 +nearest lower number.
-+If you are using linux-3.10 and aufs3.10 (which are not released yet),
-+but the "aufs3.10" branch doesn't exit in this repository, then
-+"aufs3.9", "aufs3.8", ... or something is the branch for you.
++
++For (an unreleased) example:
++If you are using "linux-3.10" and the "aufs3.10" branch
++does not exit in aufs-util repository, then "aufs3.9", "aufs3.8"
++or something numerically smaller is the branch for your kernel.
++
 +Also you can view all branches by
 +	$ git branch -a
 +
@@ -1607,6 +1618,10 @@
 +
 +And then,
 +- read README in aufs-util, build and install it
++- note that your distribution may contain an obsoleted version of
++  aufs_type.h in /usr/include/linux or something. When you build aufs
++  utilities, make sure that your compiler refers the correct aufs header
++  file which is built by "make headers_install."
 +- if you want to use readdir(3) in userspace or pathconf(3) wrapper,
 +  then run "make install_ulib" too. And refer to the aufs manual in
 +  detail.
@@ -3233,8 +3248,8 @@
 +-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	2011-08-24 13:30:24.731313534 +0200
-@@ -0,0 +1,1080 @@
++++ linux/fs/aufs/cpup.c	2012-01-05 11:00:59.215501779 +0100
+@@ -0,0 +1,1081 @@
 +/*
 + * Copyright (C) 2005-2011 Junjiro R. Okajima
 + *
@@ -3297,7 +3312,7 @@
 +	    && au_plink_test(inode))
 +		return;
 +
-+	inode->i_nlink = h_inode->i_nlink;
++	set_nlink(inode, h_inode->i_nlink);
 +
 +	/*
 +	 * fewer nlink makes find(1) noisy, but larger nlink doesn't.
@@ -3660,6 +3675,7 @@
 +	if (unlikely(!sym.k))
 +		goto out;
 +
++	/* unnecessary to support mmap_sem since symlink is not mmap-able */
 +	old_fs = get_fs();
 +	set_fs(KERNEL_DS);
 +	symlen = h_src->d_inode->i_op->readlink(h_src, sym.u, PATH_MAX);
@@ -4404,7 +4420,7 @@
 +#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	2011-08-24 13:30:24.731313534 +0200
++++ linux/fs/aufs/dbgaufs.c	2012-01-05 11:00:59.215501779 +0100
 @@ -0,0 +1,334 @@
 +/*
 + * Copyright (C) 2005-2011 Junjiro R. Okajima
@@ -4545,7 +4561,7 @@
 +		     || memcmp(name->name, DbgaufsXi_PREFIX,
 +			       sizeof(DbgaufsXi_PREFIX) - 1)))
 +		goto out;
-+	err = strict_strtol(name->name + sizeof(DbgaufsXi_PREFIX) - 1, 10, &l);
++	err = kstrtol(name->name + sizeof(DbgaufsXi_PREFIX) - 1, 10, &l);
 +	if (unlikely(err))
 +		goto out;
 +
@@ -7827,8 +7843,8 @@
 +}
 diff -urN /usr/share/empty/fs/aufs/dir.c linux/fs/aufs/dir.c
 --- /usr/share/empty/fs/aufs/dir.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dir.c	2011-10-24 20:52:23.677857076 +0200
-@@ -0,0 +1,627 @@
++++ linux/fs/aufs/dir.c	2012-01-05 11:00:59.215501779 +0100
+@@ -0,0 +1,635 @@
 +/*
 + * Copyright (C) 2005-2011 Junjiro R. Okajima
 + *
@@ -7857,20 +7873,28 @@
 +
 +void au_add_nlink(struct inode *dir, struct inode *h_dir)
 +{
++	unsigned int nlink;
++
 +	AuDebugOn(!S_ISDIR(dir->i_mode) || !S_ISDIR(h_dir->i_mode));
 +
-+	dir->i_nlink += h_dir->i_nlink - 2;
++	nlink = dir->i_nlink;
++	nlink += h_dir->i_nlink - 2;
 +	if (h_dir->i_nlink < 2)
-+		dir->i_nlink += 2;
++		nlink += 2;
++	set_nlink(dir, nlink);
 +}
 +
 +void au_sub_nlink(struct inode *dir, struct inode *h_dir)
 +{
++	unsigned int nlink;
++
 +	AuDebugOn(!S_ISDIR(dir->i_mode) || !S_ISDIR(h_dir->i_mode));
 +
-+	dir->i_nlink -= h_dir->i_nlink - 2;
++	nlink = dir->i_nlink;
++	nlink -= h_dir->i_nlink - 2;
 +	if (h_dir->i_nlink < 2)
-+		dir->i_nlink -= 2;
++		nlink -= 2;
++	set_nlink(dir, nlink);
 +}
 +
 +loff_t au_dir_size(struct file *file, struct dentry *dentry)
@@ -8188,7 +8212,7 @@
 +{
 +	int err;
 +	struct dentry *dentry;
-+	struct inode *inode;
++	struct inode *inode, *h_inode;
 +	struct super_block *sb;
 +
 +	dentry = file->f_dentry;
@@ -8207,22 +8231,22 @@
 +	if (unlikely(err))
 +		goto out_unlock;
 +
++	h_inode = au_h_iptr(inode, au_ibstart(inode));
 +	if (!au_test_nfsd()) {
 +		err = au_vdir_fill_de(file, dirent, filldir);
-+		fsstack_copy_attr_atime(inode,
-+					au_h_iptr(inode, au_ibstart(inode)));
++		fsstack_copy_attr_atime(inode, h_inode);
 +	} else {
 +		/*
 +		 * nfsd filldir may call lookup_one_len(), vfs_getattr(),
 +		 * encode_fh() and others.
 +		 */
-+		struct inode *h_inode = au_h_iptr(inode, au_ibstart(inode));
-+
++		atomic_inc(&h_inode->i_count);
 +		di_read_unlock(dentry, AuLock_IR);
 +		si_read_unlock(sb);
 +		err = au_vdir_fill_de(file, dirent, filldir);
 +		fsstack_copy_attr_atime(inode, h_inode);
 +		fi_write_unlock(file);
++		iput(h_inode);
 +
 +		AuTraceErr(err);
 +		return err;
@@ -10857,8 +10881,8 @@
 +#endif /* __AUFS_FILE_H__ */
 diff -urN /usr/share/empty/fs/aufs/finfo.c linux/fs/aufs/finfo.c
 --- /usr/share/empty/fs/aufs/finfo.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/finfo.c	2011-08-24 13:30:24.731313534 +0200
-@@ -0,0 +1,153 @@
++++ linux/fs/aufs/finfo.c	2012-01-05 11:00:59.215501779 +0100
+@@ -0,0 +1,157 @@
 +/*
 + * Copyright (C) 2005-2011 Junjiro R. Okajima
 + *
@@ -10989,7 +11013,7 @@
 +
 +int au_finfo_init(struct file *file, struct au_fidir *fidir)
 +{
-+	int err;
++	int err, lc_idx;
 +	struct au_finfo *finfo;
 +	struct dentry *dentry;
 +
@@ -11001,6 +11025,10 @@
 +
 +	err = 0;
 +	au_nfiles_inc(dentry->d_sb);
++	lc_idx = AuLcNonDir_FIINFO;
++	if (fidir)
++		lc_idx = AuLcDir_FIINFO;
++	au_rw_class(&finfo->fi_rwsem, au_lc_key + lc_idx);
 +	au_rw_write_lock(&finfo->fi_rwsem);
 +	finfo->fi_btop = -1;
 +	finfo->fi_hdir = fidir;
@@ -11014,8 +11042,8 @@
 +}
 diff -urN /usr/share/empty/fs/aufs/f_op.c linux/fs/aufs/f_op.c
 --- /usr/share/empty/fs/aufs/f_op.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/f_op.c	2011-10-24 20:52:23.677857076 +0200
-@@ -0,0 +1,711 @@
++++ linux/fs/aufs/f_op.c	2012-01-05 11:00:59.215501779 +0100
+@@ -0,0 +1,731 @@
 +/*
 + * Copyright (C) 2005-2011 Junjiro R. Okajima
 + *
@@ -11133,6 +11161,13 @@
 +}
 +
 +/* ---------------------------------------------------------------------- */
++/*
++ * read and write functions acquire [fdi]_rwsem once, but release before
++ * mmap_sem. This is because to stop a race condition between mmap(2).
++ * Releasing these aufs-rwsem should be safe, no branch-mamagement (by keeping
++ * si_rwsem), no harmful copy-up should happen. Actually copy-up may happen in
++ * read functions after [fdi]_rwsem are released, but it should be harmless.
++ */
 +
 +static ssize_t aufs_read(struct file *file, char __user *buf, size_t count,
 +			 loff_t *ppos)
@@ -11150,13 +11185,18 @@
 +		goto out;
 +
 +	h_file = au_hf_top(file);
++	get_file(h_file);
++	di_read_unlock(dentry, AuLock_IR);
++	fi_read_unlock(file);
++
++	/* filedata may be obsoleted by concurrent copyup, but no problem */
 +	err = vfsub_read_u(h_file, buf, count, ppos);
 +	/* todo: necessary? */
 +	/* file->f_ra = h_file->f_ra; */
++	/* update without lock, I don't think it a problem */
 +	fsstack_copy_attr_atime(dentry->d_inode, h_file->f_dentry->d_inode);
++	fput(h_file);
 +
-+	di_read_unlock(dentry, AuLock_IR);
-+	fi_read_unlock(file);
 +out:
 +	si_read_unlock(sb);
 +	return err;
@@ -11190,11 +11230,13 @@
 +	ssize_t err;
 +	struct au_pin pin;
 +	struct dentry *dentry;
++	struct super_block *sb;
 +	struct inode *inode;
 +	struct file *h_file;
 +	char __user *buf = (char __user *)ubuf;
 +
 +	dentry = file->f_dentry;
++	sb = dentry->d_sb;
 +	inode = dentry->d_inode;
 +	au_mtx_and_read_lock(inode);
 +
@@ -11204,20 +11246,27 @@
 +
 +	err = au_ready_to_write(file, -1, &pin);
 +	di_downgrade_lock(dentry, AuLock_IR);
-+	if (unlikely(err))
-+		goto out_unlock;
++	if (unlikely(err)) {
++		di_read_unlock(dentry, AuLock_IR);
++		fi_write_unlock(file);
++		goto out;
++	}
 +
 +	h_file = au_hf_top(file);
++	get_file(h_file);
 +	au_unpin(&pin);
++	di_read_unlock(dentry, AuLock_IR);
++	fi_write_unlock(file);
++
 +	err = vfsub_write_u(h_file, buf, count, ppos);
++	ii_write_lock_child(inode);
 +	au_cpup_attr_timesizes(inode);
 +	inode->i_mode = h_file->f_dentry->d_inode->i_mode;
++	ii_write_unlock(inode);
++	fput(h_file);
 +
-+out_unlock:
-+	di_read_unlock(dentry, AuLock_IR);
-+	fi_write_unlock(file);
 +out:
-+	si_read_unlock(inode->i_sb);
++	si_read_unlock(sb);
 +	mutex_unlock(&inode->i_mutex);
 +	return err;
 +}
@@ -11272,12 +11321,16 @@
 +		goto out;
 +
 +	h_file = au_hf_top(file);
++	get_file(h_file);
++	di_read_unlock(dentry, AuLock_IR);
++	fi_read_unlock(file);
++
 +	err = au_do_aio(h_file, MAY_READ, kio, iov, nv, pos);
 +	/* todo: necessary? */
 +	/* file->f_ra = h_file->f_ra; */
++	/* update without lock, I don't think it a problem */
 +	fsstack_copy_attr_atime(dentry->d_inode, h_file->f_dentry->d_inode);
-+	di_read_unlock(dentry, AuLock_IR);
-+	fi_read_unlock(file);
++	fput(h_file);
 +
 +out:
 +	si_read_unlock(sb);
@@ -11292,9 +11345,11 @@
 +	struct dentry *dentry;
 +	struct inode *inode;
 +	struct file *file, *h_file;
++	struct super_block *sb;
 +
 +	file = kio->ki_filp;
 +	dentry = file->f_dentry;
++	sb = dentry->d_sb;
 +	inode = dentry->d_inode;
 +	au_mtx_and_read_lock(inode);
 +
@@ -11304,20 +11359,27 @@
 +
 +	err = au_ready_to_write(file, -1, &pin);
 +	di_downgrade_lock(dentry, AuLock_IR);
-+	if (unlikely(err))
-+		goto out_unlock;
++	if (unlikely(err)) {
++		di_read_unlock(dentry, AuLock_IR);
++		fi_write_unlock(file);
++		goto out;
++	}
 +
-+	au_unpin(&pin);
 +	h_file = au_hf_top(file);
++	get_file(h_file);
++	au_unpin(&pin);
++	di_read_unlock(dentry, AuLock_IR);
++	fi_write_unlock(file);
++
 +	err = au_do_aio(h_file, MAY_WRITE, kio, iov, nv, pos);
++	ii_write_lock_child(inode);
 +	au_cpup_attr_timesizes(inode);
 +	inode->i_mode = h_file->f_dentry->d_inode->i_mode;
++	ii_write_unlock(inode);
++	fput(h_file);
 +
-+out_unlock:
-+	di_read_unlock(dentry, AuLock_IR);
-+	fi_write_unlock(file);
 +out:
-+	si_read_unlock(inode->i_sb);
++	si_read_unlock(sb);
 +	mutex_unlock(&inode->i_mutex);
 +	return err;
 +}
@@ -11340,6 +11402,7 @@
 +
 +	err = -EINVAL;
 +	h_file = au_hf_top(file);
++	get_file(h_file);
 +	if (au_test_loopback_kthread()) {
 +		au_warn_loopback(h_file->f_dentry->d_sb);
 +		if (file->f_mapping != h_file->f_mapping) {
@@ -11347,13 +11410,15 @@
 +			smp_mb(); /* unnecessary? */
 +		}
 +	}
++	di_read_unlock(dentry, AuLock_IR);
++	fi_read_unlock(file);
++
 +	err = vfsub_splice_to(h_file, ppos, pipe, len, flags);
 +	/* todo: necessasry? */
 +	/* file->f_ra = h_file->f_ra; */
++	/* update without lock, I don't think it a problem */
 +	fsstack_copy_attr_atime(dentry->d_inode, h_file->f_dentry->d_inode);
-+
-+	di_read_unlock(dentry, AuLock_IR);
-+	fi_read_unlock(file);
++	fput(h_file);
<<Diff was trimmed, longer than 597 lines>>

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



More information about the pld-cvs-commit mailing list