Author: hawk                         Date: Fri Feb 10 10:47:11 2012 GMT
Module: packages                      Tag: LINUX_2_6_32
---- Log message:
- unionfs-2.5.10_for_2.6.32.46.diff + 2.6.32.56 fix

---- Files affected:
packages/kernel:
   kernel-unionfs.patch (1.6 -> 1.6.2.1) 

---- Diffs:

================================================================
Index: packages/kernel/kernel-unionfs.patch
diff -u packages/kernel/kernel-unionfs.patch:1.6 
packages/kernel/kernel-unionfs.patch:1.6.2.1
--- packages/kernel/kernel-unionfs.patch:1.6    Tue Nov 24 00:40:35 2009
+++ packages/kernel/kernel-unionfs.patch        Fri Feb 10 11:47:06 2012
@@ -532,10 +532,10 @@
 +
 +For more information, see <http://unionfs.filesystems.org/>.
 diff --git a/MAINTAINERS b/MAINTAINERS
-index 8dca9d8..4421543 100644
+index ea3302f..696b6a1 100644
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -5095,6 +5095,14 @@ F:      Documentation/cdrom/
+@@ -5321,6 +5321,14 @@ F:      Documentation/cdrom/
  F:    drivers/cdrom/cdrom.c
  F:    include/linux/cdrom.h
  
@@ -551,10 +551,10 @@
  M:    Artem Bityutskiy <[email protected]>
  W:    http://www.linux-mtd.infradead.org/
 diff --git a/fs/Kconfig b/fs/Kconfig
-index 0e7da7b..b69b6bd 100644
+index 64d44ef..b69e2f2 100644
 --- a/fs/Kconfig
 +++ b/fs/Kconfig
-@@ -167,6 +167,7 @@ if MISC_FILESYSTEMS
+@@ -169,6 +169,7 @@ if MISC_FILESYSTEMS
  source "fs/adfs/Kconfig"
  source "fs/affs/Kconfig"
  source "fs/ecryptfs/Kconfig"
@@ -588,10 +588,10 @@
  out:
        return rc;
 diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
-index 2f0945d..e884c3b 100644
+index 88ba4d4..7b78d1c 100644
 --- a/fs/ecryptfs/inode.c
 +++ b/fs/ecryptfs/inode.c
-@@ -624,9 +624,9 @@ ecryptfs_rename(struct inode *old_dir, struct dentry 
*old_dentry,
+@@ -631,9 +631,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;
@@ -603,7 +603,7 @@
  out_lock:
        unlock_rename(lower_old_dir_dentry, lower_new_dir_dentry);
        dput(lower_new_dentry->d_parent);
-@@ -965,7 +965,7 @@ static int ecryptfs_setattr(struct dentry *dentry, struct 
iattr *ia)
+@@ -953,7 +953,7 @@ static int ecryptfs_setattr(struct dentry *dentry, struct 
iattr *ia)
        rc = notify_change(lower_dentry, ia);
        mutex_unlock(&lower_dentry->d_inode->i_mutex);
  out:
@@ -612,11 +612,20 @@
        return rc;
  }
  
+@@ -989,7 +989,7 @@ int ecryptfs_getattr(struct vfsmount *mnt, struct dentry 
*dentry,
+                        ecryptfs_dentry_to_lower(dentry), &lower_stat);
+       if (!rc) {
+               fsstack_copy_attr_all(dentry->d_inode,
+-                                    ecryptfs_inode_to_lower(dentry->d_inode), 
NULL);
++                                    ecryptfs_inode_to_lower(dentry->d_inode));
+               generic_fillattr(dentry->d_inode, stat);
+               stat->blocks = lower_stat.blocks;
+       }
 diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
-index 9f0aa98..3d94155 100644
+index c6ac85d..427588a 100644
 --- a/fs/ecryptfs/main.c
 +++ b/fs/ecryptfs/main.c
-@@ -190,7 +190,7 @@ int ecryptfs_interpose(struct dentry *lower_dentry, struct 
dentry *dentry,
+@@ -194,7 +194,7 @@ int ecryptfs_interpose(struct dentry *lower_dentry, struct 
dentry *dentry,
                init_special_inode(inode, lower_inode->i_mode,
                                   lower_inode->i_rdev);
        dentry->d_op = &ecryptfs_dops;
@@ -626,10 +635,10 @@
         * other metadata */
        fsstack_copy_inode_size(inode, lower_inode);
 diff --git a/fs/namei.c b/fs/namei.c
-index 1f13751..88584c4 100644
+index b0afbd4..c598c3d 100644
 --- a/fs/namei.c
 +++ b/fs/namei.c
-@@ -375,6 +375,7 @@ void release_open_intent(struct nameidata *nd)
+@@ -389,6 +389,7 @@ void release_open_intent(struct nameidata *nd)
        else
                fput(nd->intent.open.file);
  }
@@ -638,10 +647,10 @@
  static inline struct dentry *
  do_revalidate(struct dentry *dentry, struct nameidata *nd)
 diff --git a/fs/splice.c b/fs/splice.c
-index 73766d2..3753029 100644
+index 7737933..c45206c 100644
 --- a/fs/splice.c
 +++ b/fs/splice.c
-@@ -1057,8 +1057,8 @@ EXPORT_SYMBOL(generic_splice_sendpage);
+@@ -1043,8 +1043,8 @@ EXPORT_SYMBOL(generic_splice_sendpage);
  /*
   * Attempt to initiate a splice from pipe to file.
   */
@@ -652,7 +661,7 @@
  {
        ssize_t (*splice_write)(struct pipe_inode_info *, struct file *,
                                loff_t *, size_t, unsigned int);
-@@ -1080,13 +1080,14 @@ static long do_splice_from(struct pipe_inode_info 
*pipe, struct file *out,
+@@ -1067,13 +1067,14 @@ static long do_splice_from(struct pipe_inode_info 
*pipe, struct file *out,
  
        return splice_write(pipe, out, ppos, len, flags);
  }
@@ -670,7 +679,7 @@
  {
        ssize_t (*splice_read)(struct file *, loff_t *,
                               struct pipe_inode_info *, size_t, unsigned int);
-@@ -1105,6 +1106,7 @@ static long do_splice_to(struct file *in, loff_t *ppos,
+@@ -1093,6 +1094,7 @@ static long do_splice_to(struct file *in, loff_t *ppos,
  
        return splice_read(in, ppos, pipe, len, flags);
  }
@@ -678,7 +687,7 @@
  
  /**
   * splice_direct_to_actor - splices data directly between two non-pipes
-@@ -1174,7 +1176,7 @@ ssize_t splice_direct_to_actor(struct file *in, struct 
splice_desc *sd,
+@@ -1162,7 +1164,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;
  
@@ -687,16 +696,16 @@
                if (unlikely(ret <= 0))
                        goto out_release;
  
-@@ -1233,7 +1235,7 @@ static int direct_splice_actor(struct pipe_inode_info 
*pipe,
+@@ -1221,7 +1223,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);
+-      return do_splice_from(pipe, file, &file->f_pos, sd->total_len,
++      return vfs_splice_from(pipe, file, &file->f_pos, sd->total_len,
+                             sd->flags);
  }
  
- /**
-@@ -1330,7 +1332,7 @@ static long do_splice(struct file *in, loff_t __user 
*off_in,
+@@ -1319,7 +1321,7 @@ static long do_splice(struct file *in, loff_t __user 
*off_in,
                } else
                        off = &out->f_pos;
  
@@ -705,7 +714,7 @@
  
                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,
+@@ -1340,7 +1342,7 @@ static long do_splice(struct file *in, loff_t __user 
*off_in,
                } else
                        off = &in->f_pos;
  
@@ -856,11 +865,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..9c466a5
+index 0000000..789ea3a
 --- /dev/null
 +++ b/fs/unionfs/Makefile
 @@ -0,0 +1,17 @@
-+UNIONFS_VERSION="2.5.3 (for 2.6.31)"
++UNIONFS_VERSION="2.5.10 (for 2.6.32.46)"
 +
 +EXTRA_CFLAGS += -DUNIONFS_VERSION=\"$(UNIONFS_VERSION)\"
 +
@@ -879,12 +888,12 @@
 +endif
 diff --git a/fs/unionfs/commonfops.c b/fs/unionfs/commonfops.c
 new file mode 100644
-index 0000000..587f984
+index 0000000..0d2146c
 --- /dev/null
 +++ b/fs/unionfs/commonfops.c
-@@ -0,0 +1,896 @@
+@@ -0,0 +1,899 @@
 +/*
-+ * Copyright (c) 2003-2009 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
@@ -893,8 +902,8 @@
 + * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
 + * Copyright (c) 2003      Puja Gupta
 + * Copyright (c) 2003      Harikesavan Krishnan
-+ * Copyright (c) 2003-2009 Stony Brook University
-+ * Copyright (c) 2003-2009 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
@@ -1391,8 +1400,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 {
@@ -1781,12 +1793,12 @@
 +}
 diff --git a/fs/unionfs/copyup.c b/fs/unionfs/copyup.c
 new file mode 100644
-index 0000000..c43cc7f
+index 0000000..fe257d0
 --- /dev/null
 +++ b/fs/unionfs/copyup.c
 @@ -0,0 +1,897 @@
 +/*
-+ * Copyright (c) 2003-2009 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
@@ -1795,8 +1807,8 @@
 + * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
 + * Copyright (c) 2003      Puja Gupta
 + * Copyright (c) 2003      Harikesavan Krishnan
-+ * Copyright (c) 2003-2009 Stony Brook University
-+ * Copyright (c) 2003-2009 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
@@ -2684,15 +2696,15 @@
 +}
 diff --git a/fs/unionfs/debug.c b/fs/unionfs/debug.c
 new file mode 100644
-index 0000000..3fd641a
+index 0000000..e5485db
 --- /dev/null
 +++ b/fs/unionfs/debug.c
-@@ -0,0 +1,533 @@
+@@ -0,0 +1,534 @@
 +/*
-+ * Copyright (c) 2003-2009 Erez Zadok
++ * Copyright (c) 2003-2011 Erez Zadok
 + * Copyright (c) 2005-2007 Josef 'Jeff' Sipek
-+ * Copyright (c) 2003-2009 Stony Brook University
-+ * Copyright (c) 2003-2009 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
@@ -3052,12 +3064,13 @@
 +              pr_debug(" CF0: file/dentry=%p:%p fstart/end=%d:%d\n",
 +                       file, dentry, fstart, fend);
 +      }
-+      if (unlikely(fstart != dstart)) {
++      /* d_deleted dentries can be ignored for this test */
++      if (unlikely(fstart != dstart) && !d_deleted(dentry)) {
 +              PRINT_CALLER(fname, fxn, line);
 +              pr_debug(" CF1: file/dentry=%p:%p fstart=%d dstart=%d\n",
 +                       file, dentry, fstart, dstart);
 +      }
-+      if (unlikely(fend != dend)) {
++      if (unlikely(fend != dend) && !d_deleted(dentry)) {
 +              PRINT_CALLER(fname, fxn, line);
 +              pr_debug(" CF2: file/dentry=%p:%p fend=%d dend=%d\n",
 +                       file, dentry, fend, dend);
@@ -3223,12 +3236,12 @@
 +}
 diff --git a/fs/unionfs/dentry.c b/fs/unionfs/dentry.c
 new file mode 100644
-index 0000000..85b5d3c
+index 0000000..1be7946
 --- /dev/null
 +++ b/fs/unionfs/dentry.c
 @@ -0,0 +1,397 @@
 +/*
-+ * Copyright (c) 2003-2009 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
@@ -3237,8 +3250,8 @@
 + * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
 + * Copyright (c) 2003      Puja Gupta
 + * Copyright (c) 2003      Harikesavan Krishnan
-+ * Copyright (c) 2003-2009 Stony Brook University
-+ * Copyright (c) 2003-2009 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
@@ -3626,12 +3639,12 @@
 +};
 diff --git a/fs/unionfs/dirfops.c b/fs/unionfs/dirfops.c
 new file mode 100644
-index 0000000..eccb9ae
+index 0000000..72a9c1a
 --- /dev/null
 +++ b/fs/unionfs/dirfops.c
 @@ -0,0 +1,302 @@
 +/*
-+ * Copyright (c) 2003-2009 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
@@ -3640,8 +3653,8 @@
 + * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
 + * Copyright (c) 2003      Puja Gupta
 + * Copyright (c) 2003      Harikesavan Krishnan
-+ * Copyright (c) 2003-2009 Stony Brook University
-+ * Copyright (c) 2003-2009 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
@@ -3934,12 +3947,12 @@
 +};
 diff --git a/fs/unionfs/dirhelper.c b/fs/unionfs/dirhelper.c
 new file mode 100644
-index 0000000..2ecaafa
+index 0000000..62ec9af
 --- /dev/null
 +++ b/fs/unionfs/dirhelper.c
 @@ -0,0 +1,158 @@
 +/*
-+ * Copyright (c) 2003-2009 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
@@ -3948,8 +3961,8 @@
 + * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
 + * Copyright (c) 2003      Puja Gupta
 + * Copyright (c) 2003      Harikesavan Krishnan
-+ * Copyright (c) 2003-2009 Stony Brook University
-+ * Copyright (c) 2003-2009 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
@@ -4098,12 +4111,12 @@
 +}
 diff --git a/fs/unionfs/fanout.h b/fs/unionfs/fanout.h
 new file mode 100644
-index 0000000..04ffa85
+index 0000000..ae1b86a
 --- /dev/null
 +++ b/fs/unionfs/fanout.h
 @@ -0,0 +1,407 @@
 +/*
-+ * Copyright (c) 2003-2009 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
@@ -4111,8 +4124,8 @@
 + * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
 + * Copyright (c) 2003      Puja Gupta
 + * Copyright (c) 2003      Harikesavan Krishnan
-+ * Copyright (c) 2003-2009 Stony Brook University
-+ * Copyright (c) 2003-2009 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
@@ -4511,12 +4524,12 @@
 +#endif        /* not _FANOUT_H */
 diff --git a/fs/unionfs/file.c b/fs/unionfs/file.c
 new file mode 100644
-index 0000000..281169e
+index 0000000..def6b1d
 --- /dev/null
 +++ b/fs/unionfs/file.c
 @@ -0,0 +1,380 @@
 +/*
-+ * Copyright (c) 2003-2009 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
@@ -4525,8 +4538,8 @@
 + * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
 + * Copyright (c) 2003      Puja Gupta
 + * Copyright (c) 2003      Harikesavan Krishnan
-+ * Copyright (c) 2003-2009 Stony Brook University
-+ * Copyright (c) 2003-2009 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
@@ -4615,7 +4628,7 @@
 +      struct file *lower_file;
 +      struct dentry *dentry = file->f_path.dentry;
 +      struct dentry *parent;
-+      struct vm_operations_struct *saved_vm_ops = NULL;
++      const struct vm_operations_struct *saved_vm_ops = NULL;
 +
 +      /*
 +       * Since mm/memory.c:might_fault() (under PROVE_LOCKING) was
@@ -4897,12 +4910,12 @@
 +};
 diff --git a/fs/unionfs/inode.c b/fs/unionfs/inode.c
 new file mode 100644
-index 0000000..bd5a3b3
+index 0000000..04c64be
 --- /dev/null
 +++ b/fs/unionfs/inode.c
-@@ -0,0 +1,1055 @@
+@@ -0,0 +1,1083 @@
 +/*
-+ * Copyright (c) 2003-2009 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
@@ -4911,8 +4924,8 @@
 + * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
 + * Copyright (c) 2003      Puja Gupta
 + * Copyright (c) 2003      Harikesavan Krishnan
-+ * Copyright (c) 2003-2009 Stony Brook University
-+ * Copyright (c) 2003-2009 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
@@ -5028,12 +5041,12 @@
 +      lower_parent_dentry = lock_parent(lower_dentry);
 +      if (IS_ERR(lower_parent_dentry)) {
 +              err = PTR_ERR(lower_parent_dentry);
-+              goto out;
++              goto out_unlock;
 +      }
 +
 +      err = init_lower_nd(&lower_nd, LOOKUP_CREATE);
 +      if (unlikely(err < 0))
-+              goto out;
++              goto out_unlock;
 +      err = vfs_create(lower_parent_dentry->d_inode, lower_dentry, mode,
 +                       &lower_nd);
 +      release_lower_nd(&lower_nd, err);
@@ -5049,8 +5062,8 @@
 +              }
 +      }
 +
++out_unlock:
 +      unlock_dir(lower_parent_dentry);
-+
 +out:
 +      if (!err) {
 +              unionfs_postcopyup_setmnt(dentry);
@@ -5293,7 +5306,7 @@
 +      lower_parent_dentry = lock_parent(lower_dentry);
 +      if (IS_ERR(lower_parent_dentry)) {
 +              err = PTR_ERR(lower_parent_dentry);
-+              goto out;
++              goto out_unlock;
 +      }
 +
 +      mode = S_IALLUGO;
@@ -5309,8 +5322,8 @@
 +              }
 +      }
 +
++out_unlock:
 +      unlock_dir(lower_parent_dentry);
-+
 +out:
 +      dput(wh_dentry);
 +      kfree(name);
@@ -5486,7 +5499,7 @@
 +      lower_parent_dentry = lock_parent(lower_dentry);
 +      if (IS_ERR(lower_parent_dentry)) {
 +              err = PTR_ERR(lower_parent_dentry);
-+              goto out;
++              goto out_unlock;
 +      }
 +
 +      err = vfs_mknod(lower_parent_dentry->d_inode, lower_dentry, mode, dev);
@@ -5501,8 +5514,8 @@
 +              }
 +      }
 +
++out_unlock:
 +      unlock_dir(lower_parent_dentry);
-+
 +out:
 +      dput(wh_dentry);
 +      kfree(name);
@@ -5798,6 +5811,12 @@
 +      struct inode *lower_inode;
 +      int bstart, bend, bindex;
 +      loff_t size;
++      struct iattr lower_ia;
++
++      /* check if user has permission to change inode */
++      err = inode_change_ok(dentry->d_inode, ia);
++      if (err)
++              goto out_err;
 +
 +      unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_CHILD);
 +      parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
@@ -5824,7 +5843,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);
@@ -5859,6 +5883,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;
++              }
 +      }
 +
 +      /*
@@ -5885,8 +5919,15 @@
 +       * unlinked (no inode->i_sb and i_ino==0.  This happens if someone
 +       * tries to open(), unlink(), then ftruncate() a file.
 +       */
++      /* prepare our own lower struct iattr (with our own lower file) */
++      memcpy(&lower_ia, ia, sizeof(lower_ia));
++      if (ia->ia_valid & ATTR_FILE) {
++              lower_ia.ia_file = unionfs_lower_file(ia->ia_file);
++              BUG_ON(!lower_ia.ia_file); // XXX?
++      }
++
 +      mutex_lock(&lower_dentry->d_inode->i_mutex);
-+      err = notify_change(lower_dentry, ia);
++      err = notify_change(lower_dentry, &lower_ia);
 +      mutex_unlock(&lower_dentry->d_inode->i_mutex);
 +      if (err)
 +              goto out;
@@ -5914,7 +5955,7 @@
 +      unionfs_unlock_dentry(dentry);
 +      unionfs_unlock_parent(dentry, parent);
 +      unionfs_read_unlock(dentry->d_sb);
-+
++out_err:
 +      return err;
 +}
 +
@@ -5958,12 +5999,12 @@
 +};
 diff --git a/fs/unionfs/lookup.c b/fs/unionfs/lookup.c
 new file mode 100644
-index 0000000..6361541
+index 0000000..3cbde56
 --- /dev/null
 +++ b/fs/unionfs/lookup.c
 @@ -0,0 +1,569 @@
 +/*
-+ * Copyright (c) 2003-2009 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
@@ -5972,8 +6013,8 @@
 + * Copyright (c) 2003-2004 Mohammad Nayyer Zubair
 + * Copyright (c) 2003      Puja Gupta
 + * Copyright (c) 2003      Harikesavan Krishnan
-+ * Copyright (c) 2003-2009 Stony Brook University
-+ * Copyright (c) 2003-2009 The Research Foundation of SUNY
<<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.6&r2=1.6.2.1&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to