Author: zbyniu                       Date: Thu May 29 14:22:16 2008 GMT
Module: SOURCES                       Tag: LINUX_2_6
---- Log message:
- adapted for vserver/grsec changes in vfs api (partialy merged)

---- Files affected:
SOURCES:
   kernel-apparmor.patch (1.1.2.1 -> 1.1.2.2) 

---- Diffs:

================================================================
Index: SOURCES/kernel-apparmor.patch
diff -u SOURCES/kernel-apparmor.patch:1.1.2.1 
SOURCES/kernel-apparmor.patch:1.1.2.2
--- SOURCES/kernel-apparmor.patch:1.1.2.1       Thu May 29 16:20:14 2008
+++ SOURCES/kernel-apparmor.patch       Thu May 29 16:22:11 2008
@@ -377,10 +377,10 @@
        dget(lower_new_dentry);
        lower_dir_dentry = lock_parent(lower_new_dentry);
 -      rc = vfs_link(lower_old_dentry, lower_dir_dentry->d_inode,
--                    lower_new_dentry);
+-                    lower_new_dentry, NULL);
 +      rc = vfs_link(lower_old_dentry, lower_old_mnt,
 +                    lower_dir_dentry->d_inode, lower_new_dentry,
-+                    lower_new_mnt);
++                    lower_new_mnt, NULL);
        if (rc || !lower_new_dentry->d_inode)
                goto out_lock;
        rc = ecryptfs_interpose(lower_new_dentry, new_dentry, dir->i_sb, 0);
@@ -392,8 +392,8 @@
        struct inode *lower_dir_inode = ecryptfs_inode_to_lower(dir);
  
        lock_parent(lower_dentry);
--      rc = vfs_unlink(lower_dir_inode, lower_dentry);
-+      rc = vfs_unlink(lower_dir_inode, lower_dentry, lower_mnt);
+-      rc = vfs_unlink(lower_dir_inode, lower_dentry, NULL);
++      rc = vfs_unlink(lower_dir_inode, lower_dentry, NULL, lower_mnt);
        if (rc) {
                printk(KERN_ERR "Error in vfs_unlink; rc = [%d]\n", rc);
                goto out_unlock;
@@ -419,7 +419,7 @@
        }
 -      rc = vfs_symlink(lower_dir_dentry->d_inode, lower_dentry,
 +      rc = vfs_symlink(lower_dir_dentry->d_inode, lower_dentry, lower_mnt,
-                        encoded_symname, mode);
+                        encoded_symname, mode, NULL);
        kfree(encoded_symname);
        if (rc || !lower_dentry->d_inode)
 @@ -487,11 +495,14 @@ static int ecryptfs_mkdir(struct inode *
@@ -432,9 +432,9 @@
        lower_dentry = ecryptfs_dentry_to_lower(dentry);
 +      lower_mnt = ecryptfs_dentry_to_lower_mnt(dentry);
        lower_dir_dentry = lock_parent(lower_dentry);
--      rc = vfs_mkdir(lower_dir_dentry->d_inode, lower_dentry, mode);
+-      rc = vfs_mkdir(lower_dir_dentry->d_inode, lower_dentry, mode, NULL);
 +      rc = vfs_mkdir(lower_dir_dentry->d_inode, lower_dentry, lower_mnt,
-+                     mode);
++                     mode, NULL);
        if (rc || !lower_dentry->d_inode)
                goto out;
        rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb, 0);
@@ -451,8 +451,8 @@
        dget(dentry);
        lower_dir_dentry = lock_parent(lower_dentry);
        dget(lower_dentry);
--      rc = vfs_rmdir(lower_dir_dentry->d_inode, lower_dentry);
-+      rc = vfs_rmdir(lower_dir_dentry->d_inode, lower_dentry, lower_mnt);
+-      rc = vfs_rmdir(lower_dir_dentry->d_inode, lower_dentry, NULL);
++      rc = vfs_rmdir(lower_dir_dentry->d_inode, lower_dentry, NULL, 
lower_mnt);
        dput(lower_dentry);
        if (!rc)
                d_delete(lower_dentry);
@@ -466,9 +466,9 @@
        lower_dentry = ecryptfs_dentry_to_lower(dentry);
 +      lower_mnt = ecryptfs_dentry_to_lower_mnt(dentry);
        lower_dir_dentry = lock_parent(lower_dentry);
--      rc = vfs_mknod(lower_dir_dentry->d_inode, lower_dentry, mode, dev);
+-      rc = vfs_mknod(lower_dir_dentry->d_inode, lower_dentry, mode, dev, 
NULL);
 +      rc = vfs_mknod(lower_dir_dentry->d_inode, lower_dentry, lower_mnt, mode,
-+                     dev);
++                     dev, NULL);
        if (rc || !lower_dentry->d_inode)
                goto out;
        rc = ecryptfs_interpose(lower_dentry, dentry, dir->i_sb, 0);
@@ -746,13 +746,14 @@
                                            ATTR_MTIME|ATTR_CTIME|ATTR_OPEN,
                                            NULL);
                }
-@@ -1921,7 +1925,8 @@ fail:
+@@ -1921,8 +1925,8 @@ fail:
  }
  EXPORT_SYMBOL_GPL(lookup_create);
  
--int vfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t dev)
+-int vfs_mknod(struct inode *dir, struct dentry *dentry,
+-      int mode, dev_t dev, struct nameidata *nd)
 +int vfs_mknod(struct inode *dir, struct dentry *dentry, struct vfsmount *mnt,
-+            int mode, dev_t dev)
++      int mode, dev_t dev, struct nameidata *nd)
  {
        int error = may_create(dir, dentry, NULL);
  
@@ -765,31 +766,33 @@
        if (error)
                return error;
  
-@@ -1973,11 +1978,12 @@ asmlinkage long sys_mknodat(int dfd, con
+@@ -1973,12 +1978,12 @@ asmlinkage long sys_mknodat(int dfd, con
                        error = 
vfs_create(nd.path.dentry->d_inode,dentry,mode,&nd);
                        break;
                case S_IFCHR: case S_IFBLK:
--                      error = vfs_mknod(nd.path.dentry->d_inode,dentry,mode,
--                                      new_decode_dev(dev));
+-                      error = vfs_mknod(nd.path.dentry->d_inode, dentry, mode,
+-                                      new_decode_dev(dev), &nd);
 +                      error = vfs_mknod(nd.path.dentry->d_inode, dentry,
-+                                        nd.path.mnt, mode, 
new_decode_dev(dev));
++                                        nd.path.mnt, mode, 
new_decode_dev(dev), &nd);
                        break;
                case S_IFIFO: case S_IFSOCK:
--                      error = 
vfs_mknod(nd.path.dentry->d_inode,dentry,mode,0);
+-                      error = vfs_mknod(nd.path.dentry->d_inode, dentry, mode,
+-                                      0, &nd);
 +                      error = vfs_mknod(nd.path.dentry->d_inode, dentry,
-+                                        nd.path.mnt, mode, 0);
++                                        nd.path.mnt, mode, 0, &nd);
                        break;
                case S_IFDIR:
                        error = -EPERM;
-@@ -2000,7 +2006,8 @@ asmlinkage long sys_mknod(const char __u
+@@ -2000,8 +2006,8 @@ asmlinkage long sys_mknod(const char __u
        return sys_mknodat(AT_FDCWD, filename, mode, dev);
  }
  
--int vfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
+-int vfs_mkdir(struct inode *dir, struct dentry *dentry,
+-      int mode, struct nameidata *nd)
 +int vfs_mkdir(struct inode *dir, struct dentry *dentry, struct vfsmount *mnt,
-+            int mode)
++            int mode, struct nameidata *nd)
  {
-       int error = may_create(dir, dentry, NULL);
+       int error = may_create(dir, dentry, nd);
  
 @@ -2011,7 +2018,7 @@ int vfs_mkdir(struct inode *dir, struct 
                return -EPERM;
@@ -804,17 +807,19 @@
  
        if (!IS_POSIXACL(nd.path.dentry->d_inode))
                mode &= ~current->fs->umask;
--      error = vfs_mkdir(nd.path.dentry->d_inode, dentry, mode);
-+      error = vfs_mkdir(nd.path.dentry->d_inode, dentry, nd.path.mnt, mode);
+-      error = vfs_mkdir(nd.path.dentry->d_inode, dentry, mode, &nd);
++      error = vfs_mkdir(nd.path.dentry->d_inode, dentry, nd.path.mnt, mode, 
&nd);
        dput(dentry);
  out_unlock:
        mutex_unlock(&nd.path.dentry->d_inode->i_mutex);
-@@ -2087,7 +2094,7 @@ void dentry_unhash(struct dentry *dentry
+@@ -2087,8 +2094,8 @@ void dentry_unhash(struct dentry *dentry
        spin_unlock(&dcache_lock);
  }
  
--int vfs_rmdir(struct inode *dir, struct dentry *dentry)
-+int vfs_rmdir(struct inode *dir, struct dentry *dentry,struct vfsmount *mnt)
+-int vfs_rmdir(struct inode *dir, struct dentry *dentry,
+-      struct nameidata *nd)
++int vfs_rmdir(struct inode *dir, struct dentry *dentry,
++      struct nameidata *nd, struct vfsmount *mnt)
  {
        int error = may_delete(dir, dentry, 1);
  
@@ -849,19 +854,21 @@
        error = PTR_ERR(dentry);
        if (IS_ERR(dentry))
                goto exit2;
--      error = vfs_rmdir(nd.path.dentry->d_inode, dentry);
-+      error = vfs_rmdir(nd.path.dentry->d_inode, dentry, nd.path.mnt);
+-      error = vfs_rmdir(nd.path.dentry->d_inode, dentry, &nd);
++      error = vfs_rmdir(nd.path.dentry->d_inode, dentry, &nd, nd.path.mnt);
        dput(dentry);
  exit2:
        mutex_unlock(&nd.path.dentry->d_inode->i_mutex);
-@@ -2167,7 +2175,7 @@ asmlinkage long sys_rmdir(const char __u
+@@ -2167,8 +2175,8 @@ asmlinkage long sys_rmdir(const char __u
        return do_rmdir(AT_FDCWD, pathname);
  }
  
--int vfs_unlink(struct inode *dir, struct dentry *dentry)
-+int vfs_unlink(struct inode *dir, struct dentry *dentry, struct vfsmount *mnt)
+-int vfs_unlink(struct inode *dir, struct dentry *dentry,
+-      struct nameidata *nd)
++int vfs_unlink(struct inode *dir, struct dentry *dentry, 
++      struct nameidata *nd, struct vfsmount *mnt)
  {
-       int error = may_delete(dir, dentry, 0);
+       int error = may_delete(dir, dentry, 0, nd);
  
 @@ -2183,7 +2191,7 @@ int vfs_unlink(struct inode *dir, struct
        if (d_mountpoint(dentry))
@@ -876,21 +883,20 @@
                inode = dentry->d_inode;
                if (inode)
                        atomic_inc(&inode->i_count);
--              error = vfs_unlink(nd.path.dentry->d_inode, dentry);
-+              error = vfs_unlink(nd.path.dentry->d_inode, dentry, 
nd.path.mnt);
+-              error = vfs_unlink(nd.path.dentry->d_inode, dentry, &nd);
++              error = vfs_unlink(nd.path.dentry->d_inode, dentry, &nd, 
nd.path.mnt);
        exit2:
                dput(dentry);
        }
-@@ -2267,7 +2275,8 @@ asmlinkage long sys_unlink(const char __
+@@ -2267,7 +2275,7 @@ asmlinkage long sys_unlink(const char __
        return do_unlinkat(AT_FDCWD, pathname);
  }
  
--int vfs_symlink(struct inode *dir, struct dentry *dentry, const char 
*oldname, int mode)
+-int vfs_symlink(struct inode *dir, struct dentry *dentry,
 +int vfs_symlink(struct inode *dir, struct dentry *dentry, struct vfsmount 
*mnt,
-+              const char *oldname, int mode)
+       const char *oldname, int mode, struct nameidata *nd)
+       const char *oldname, int mode, struct nameidata *nd)
  {
-       int error = may_create(dir, dentry, NULL);
- 
 @@ -2277,7 +2286,7 @@ int vfs_symlink(struct inode *dir, struc
        if (!dir->i_op || !dir->i_op->symlink)
                return -EPERM;
@@ -900,22 +906,25 @@
        if (error)
                return error;
  
-@@ -2313,7 +2322,8 @@ asmlinkage long sys_symlinkat(const char
+@@ -2313,8 +2322,8 @@ asmlinkage long sys_symlinkat(const char
        if (IS_ERR(dentry))
                goto out_unlock;
  
--      error = vfs_symlink(nd.path.dentry->d_inode, dentry, from, S_IALLUGO);
+-      error = vfs_symlink(nd.path.dentry->d_inode, dentry, from,
+-              S_IALLUGO, &nd);
 +      error = vfs_symlink(nd.path.dentry->d_inode, dentry, nd.path.mnt, from,
-+                          S_IALLUGO);
++                          S_IALLUGO, &nd);
        dput(dentry);
  out_unlock:
        mutex_unlock(&nd.path.dentry->d_inode->i_mutex);
-@@ -2330,7 +2340,7 @@ asmlinkage long sys_symlink(const char _
+@@ -2330,8 +2340,8 @@ asmlinkage long sys_symlink(const char _
        return sys_symlinkat(oldname, AT_FDCWD, newname);
  }
  
--int vfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry 
*new_dentry)
-+int vfs_link(struct dentry *old_dentry, struct vfsmount *old_mnt, struct 
inode *dir, struct dentry *new_dentry, struct vfsmount *new_mnt)
+-int vfs_link(struct dentry *old_dentry, struct inode *dir,
+-      struct dentry *new_dentry, struct nameidata *nd)
++int vfs_link(struct dentry *old_dentry, struct vfsmount *old_mnt, struct 
inode *dir,
++      struct dentry *new_dentry, struct vfsmount *new_mnt, struct nameidata 
*nd)
  {
        struct inode *inode = old_dentry->d_inode;
        int error;
@@ -929,16 +938,17 @@
        if (error)
                return error;
  
-@@ -2408,7 +2419,8 @@ asmlinkage long sys_linkat(int olddfd, c
-       error = PTR_ERR(new_dentry);
-       if (IS_ERR(new_dentry))
-               goto out_unlock;
--      error = vfs_link(old_nd.path.dentry, nd.path.dentry->d_inode, 
new_dentry);
+@@ -2408,8 +2419,8 @@ asmlinkage long sys_linkat(int olddfd, c
+               goto out_unlock_dput;
+       }
+ 
+-      error = vfs_link(old_nd.path.dentry, nd.path.dentry->d_inode,
+-              new_dentry, &nd);
 +      error = vfs_link(old_nd.path.dentry, old_nd.path.mnt, 
nd.path.dentry->d_inode,
-+                       new_dentry, nd.path.mnt);
++                       new_dentry, nd.path.mnt, &nd);
+ out_unlock_dput:
        dput(new_dentry);
  out_unlock:
-       mutex_unlock(&nd.path.dentry->d_inode->i_mutex);
 @@ -2460,7 +2472,8 @@ asmlinkage long sys_link(const char __us
   *       locking].
   */
@@ -1052,9 +1062,9 @@
                dprintk("NFSD: nfsd4_create_clid_dir: DIRECTORY EXISTS\n");
                goto out_put;
        }
--      status = vfs_mkdir(rec_dir.path.dentry->d_inode, dentry, S_IRWXU);
+-      status = vfs_mkdir(rec_dir.path.dentry->d_inode, dentry, S_IRWXU, NULL);
 +      status = vfs_mkdir(rec_dir.path.dentry->d_inode, dentry,
-+                         rec_dir.path.mnt, S_IRWXU);
++                         rec_dir.path.mnt, S_IRWXU, NULL);
  out_put:
        dput(dentry);
  out_unlock:
@@ -1062,8 +1072,8 @@
                return -EINVAL;
        }
        mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT);
--      status = vfs_unlink(dir->d_inode, dentry);
-+      status = vfs_unlink(dir->d_inode, dentry, rec_dir.path.mnt);
+-      status = vfs_unlink(dir->d_inode, dentry, NULL);
++      status = vfs_unlink(dir->d_inode, dentry, NULL, rec_dir.path.mnt);
        mutex_unlock(&dir->d_inode->i_mutex);
        return status;
  }
@@ -1071,8 +1081,8 @@
         * a kernel from the future.... */
        nfsd4_list_rec_dir(dentry, nfsd4_remove_clid_file);
        mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT);
--      status = vfs_rmdir(dir->d_inode, dentry);
-+      status = vfs_rmdir(dir->d_inode, dentry, rec_dir.path.mnt);
+-      status = vfs_rmdir(dir->d_inode, dentry, NULL);
++      status = vfs_rmdir(dir->d_inode, dentry, NULL, rec_dir.path.mnt);
        mutex_unlock(&dir->d_inode->i_mutex);
        return status;
  }
@@ -1271,16 +1281,16 @@
                host_err = vfs_create(dirp, dchild, iap->ia_mode, NULL);
                break;
        case S_IFDIR:
--              host_err = vfs_mkdir(dirp, dchild, iap->ia_mode);
-+              host_err = vfs_mkdir(dirp, dchild, exp->ex_path.mnt, 
iap->ia_mode);
+-              host_err = vfs_mkdir(dirp, dchild, iap->ia_mode, NULL);
++              host_err = vfs_mkdir(dirp, dchild, exp->ex_path.mnt, 
iap->ia_mode, NULL);
                break;
        case S_IFCHR:
        case S_IFBLK:
        case S_IFIFO:
        case S_IFSOCK:
--              host_err = vfs_mknod(dirp, dchild, iap->ia_mode, rdev);
+-              host_err = vfs_mknod(dirp, dchild, iap->ia_mode, rdev, NULL);
 +              host_err = vfs_mknod(dirp, dchild, exp->ex_path.mnt,
-+                                   iap->ia_mode, rdev);
++                                   iap->ia_mode, rdev, NULL);
                break;
        default:
                printk("nfsd: bad file type %o in nfsd_create\n", type);
@@ -1309,19 +1319,19 @@
        if (unlikely(path[plen] != 0)) {
                char *path_alloced = kmalloc(plen+1, GFP_KERNEL);
                if (path_alloced == NULL)
-@@ -1529,20 +1541,22 @@ nfsd_symlink(struct svc_rqst *rqstp, str
-               else {
+@@ -1529,21 +1541,21 @@ nfsd_symlink(struct svc_rqst *rqstp, str
                        strncpy(path_alloced, path, plen);
                        path_alloced[plen] = 0;
--                      host_err = vfs_symlink(dentry->d_inode, dnew, 
path_alloced, mode);
-+                      host_err = vfs_symlink(dentry->d_inode, dnew,
-+                                             exp->ex_path.mnt, path_alloced, 
mode);
+                       host_err = vfs_symlink(dentry->d_inode, dnew,
+-                              path_alloced, mode, NULL);
++                              exp->ex_path.mnt, path_alloced, mode, NULL);
                        kfree(path_alloced);
                }
        } else
--              host_err = vfs_symlink(dentry->d_inode, dnew, path, mode);
+-              host_err = vfs_symlink(dentry->d_inode, dnew,
+-                      path, mode, NULL);
 +              host_err = vfs_symlink(dentry->d_inode, dnew, exp->ex_path.mnt,
-+                                     path, mode);
++                                     path, mode, NULL);
  
        if (!host_err) {
 -              if (EX_ISSYNC(fhp->fh_export))
@@ -1340,9 +1350,9 @@
        dold = tfhp->fh_dentry;
        dest = dold->d_inode;
  
--      host_err = vfs_link(dold, dirp, dnew);
+-      host_err = vfs_link(dold, dirp, dnew, NULL);
 +      host_err = vfs_link(dold, tfhp->fh_export->ex_path.mnt, dirp,
-+                          dnew, ffhp->fh_export->ex_path.mnt);
++                          dnew, ffhp->fh_export->ex_path.mnt, NULL);
        if (!host_err) {
                if (EX_ISSYNC(ffhp->fh_export)) {
                        err = nfserrno(nfsd_sync_dir(ddir));
@@ -1382,11 +1392,11 @@
                        host_err = -EPERM;
                } else
  #endif
--              host_err = vfs_unlink(dirp, rdentry);
-+              host_err = vfs_unlink(dirp, rdentry, exp->ex_path.mnt);
+-              host_err = vfs_unlink(dirp, rdentry, NULL);
++              host_err = vfs_unlink(dirp, rdentry, NULL, exp->ex_path.mnt);
        } else { /* It's RMDIR */
--              host_err = vfs_rmdir(dirp, rdentry);
-+              host_err = vfs_rmdir(dirp, rdentry, exp->ex_path.mnt);
+-              host_err = vfs_rmdir(dirp, rdentry, NULL);
++              host_err = vfs_rmdir(dirp, rdentry, NULL, exp->ex_path.mnt);
        }
  
        dput(rdentry);
@@ -1545,17 +1555,16 @@
        mutex_unlock(&inode->i_mutex);
  
  dput_and_out:
-@@ -627,7 +626,8 @@ asmlinkage long sys_chmod(const char __u
-       return sys_fchmodat(AT_FDCWD, filename, mode);
+@@ -627,7 +626,7 @@ asmlinkage long sys_chmod(const char __u
  }
  
--static int chown_common(struct dentry * dentry, uid_t user, gid_t group)
-+static int chown_common(struct dentry * dentry, struct vfsmount *mnt,
+ static int chown_common(struct dentry *dentry, struct vfsmount *mnt,
+-      uid_t user, gid_t group)
 +                      uid_t user, gid_t group, struct file *file)
  {
        struct inode * inode;
        int error;
-@@ -656,8 +656,11 @@ static int chown_common(struct dentry * 
+@@ -666,8 +666,11 @@ static int chown_common(struct dentry * 
        if (!S_ISDIR(inode->i_mode))
                newattrs.ia_valid |=
                        ATTR_KILL_SUID | ATTR_KILL_SGID | ATTR_KILL_PRIV;
@@ -1568,30 +1577,30 @@
        mutex_unlock(&inode->i_mutex);
  out:
        return error;
-@@ -671,7 +674,7 @@ asmlinkage long sys_chown(const char __u
-       error = user_path_walk(filename, &nd);
-       if (error)
-               goto out;
--      error = chown_common(nd.path.dentry, user, group);
-+      error = chown_common(nd.path.dentry, nd.path.mnt, user, group, NULL);
+@@ -671,7 +686,7 @@ asmlinkage long sys_chown(const char __u
+       error = cow_check_and_break(&nd);
+       if (!error)
+ #endif
+-              error = chown_common(nd.path.dentry, nd.path.mnt, user, group);
++              error = chown_common(nd.path.dentry, nd.path.mnt, user, group, 
NULL);
        path_put(&nd.path);
  out:
        return error;
-@@ -691,7 +694,7 @@ asmlinkage long sys_fchownat(int dfd, co
+@@ -691,7 +710,7 @@ asmlinkage long sys_fchownat(int dfd, co
        error = __user_walk_fd(dfd, filename, follow, &nd);
-       if (error)
-               goto out;
--      error = chown_common(nd.path.dentry, user, group);
-+      error = chown_common(nd.path.dentry, nd.path.mnt, user, group, NULL);
+       if (!error)
+ #endif
+-              error = chown_common(nd.path.dentry, nd.path.mnt, user, group);
++              error = chown_common(nd.path.dentry, nd.path.mnt, user, group, 
NULL);
        path_put(&nd.path);
  out:
        return error;
 @@ -705,7 +708,7 @@ asmlinkage long sys_lchown(const char __
-       error = user_path_walk_link(filename, &nd);
-       if (error)
-               goto out;
--      error = chown_common(nd.path.dentry, user, group);
-+      error = chown_common(nd.path.dentry, nd.path.mnt, user, group, NULL);
+       error = cow_check_and_break(&nd);
+       if (!error)
+ #endif
+-              error = chown_common(nd.path.dentry, nd.path.mnt, user, group);
++              error = chown_common(nd.path.dentry, nd.path.mnt, user, group, 
NULL);
        path_put(&nd.path);
  out:
        return error;
@@ -1599,7 +1608,7 @@
  
        dentry = file->f_path.dentry;
        audit_inode(NULL, dentry);
--      error = chown_common(dentry, user, group);
+-      error = chown_common(dentry, file->f_vfsmnt, user, group);
 +      error = chown_common(dentry, file->f_path.mnt, user, group, file);
        fput(file);
  out:
@@ -1620,8 +1629,8 @@
        if (dir->d_inode->i_nlink <= 2) {
                root = get_xa_root(inode->i_sb, XATTR_REPLACE);
                reiserfs_write_lock_xattrs(inode->i_sb);
--              err = vfs_rmdir(root->d_inode, dir);
-+              err = vfs_rmdir(root->d_inode, dir, NULL);
+-              err = vfs_rmdir(root->d_inode, dir, NULL);
++              err = vfs_rmdir(root->d_inode, dir, NULL, NULL);
                reiserfs_write_unlock_xattrs(inode->i_sb);
                dput(root);
        } else {
@@ -1700,7 +1709,7 @@
        struct inode *inode;
        struct iattr newattrs;
        struct file *f = NULL;
-@@ -83,16 +83,16 @@ long do_utimes(int dfd, char __user *fil
+@@ -83,19 +83,19 @@ long do_utimes(int dfd, char __user *fil
                f = fget(dfd);
                if (!f)
                        goto out;
@@ -1711,6 +1720,9 @@
                if (error)
                        goto out;
  
+               error = cow_check_and_break(&nd);
+               if (error)
+                       goto dput_and_out;
 -              dentry = nd.path.dentry;
 +              path = nd.path;
        }
@@ -1826,14 +1838,12 @@
        if (error)
                return error;
  
-@@ -219,8 +223,8 @@ EXPORT_SYMBOL_GPL(vfs_removexattr);
-  * Extended attribute SET operations
+@@ -219,7 +223,7 @@ EXPORT_SYMBOL_GPL(vfs_removexattr);
   */
  static long
--setxattr(struct dentry *d, char __user *name, void __user *value,
--       size_t size, int flags)
-+setxattr(struct dentry *dentry, struct vfsmount *mnt, char __user *name,
-+       void __user *value, size_t size, int flags, struct file *file)
+ setxattr(struct dentry *d, char __user *name, void __user *value,
+-       size_t size, int flags, struct vfsmount *mnt)
++       size_t size, int flags, struct vfsmount *mnt, struct file *file)
  {
        int error;
        void *kvalue = NULL;
@@ -1842,7 +1852,7 @@
        }
  
 -      error = vfs_setxattr(d, kname, kvalue, size, flags);
-+      error = vfs_setxattr(dentry, mnt, kname, kvalue, size, flags, file);
++      error = vfs_setxattr(d, mnt, kname, kvalue, size, flags, file);
        kfree(kvalue);
        return error;
  }
@@ -1850,8 +1860,8 @@
        error = user_path_walk(path, &nd);
        if (error)
                return error;
--      error = setxattr(nd.path.dentry, name, value, size, flags);
-+      error = setxattr(nd.path.dentry, nd.path.mnt, name, value, size, flags, 
NULL);
+-      error = setxattr(nd.path.dentry, name, value, size, flags, nd.path.mnt);
++      error = setxattr(nd.path.dentry, name, value, size, flags, nd.path.mnt, 
NULL);
        path_put(&nd.path);
        return error;
  }
@@ -1859,8 +1869,8 @@
        error = user_path_walk_link(path, &nd);
        if (error)
                return error;
--      error = setxattr(nd.path.dentry, name, value, size, flags);
-+      error = setxattr(nd.path.dentry, nd.path.mnt, name, value, size, flags, 
NULL);
+-      error = setxattr(nd.path.dentry, name, value, size, flags, nd.path.mnt);
++      error = setxattr(nd.path.dentry, name, value, size, flags, nd.path.mnt, 
NULL);
        path_put(&nd.path);
        return error;
  }
@@ -1868,8 +1878,8 @@
                return error;
        dentry = f->f_path.dentry;
        audit_inode(NULL, dentry);
--      error = setxattr(dentry, name, value, size, flags);
-+      error = setxattr(dentry, f->f_vfsmnt, name, value, size, flags, f);
+-      error = setxattr(dentry, name, value, size, flags, f->f_vfsmnt);
++      error = setxattr(dentry, name, value, size, flags, f->f_vfsmnt, f);
        fput(f);
        return error;
  }
@@ -1969,8 +1979,8 @@
   * Extended attribute REMOVE operations
   */
  static long
--removexattr(struct dentry *d, char __user *name)
-+removexattr(struct dentry *dentry, struct vfsmount *mnt, char __user *name,
+-removexattr(struct dentry *d, char __user *name, struct vfsmount *mnt)
++removexattr(struct dentry *dentry, char __user *name, struct vfsmount *mnt,
 +          struct file *file)
  {
        int error;
@@ -1988,8 +1998,8 @@
        error = user_path_walk(path, &nd);
        if (error)
                return error;
--      error = removexattr(nd.path.dentry, name);
-+      error = removexattr(nd.path.dentry, nd.path.mnt, name, NULL);
+-      error = removexattr(nd.path.dentry, name, nd.path.mnt);
++      error = removexattr(nd.path.dentry, name, nd.path.mnt, NULL);
        path_put(&nd.path);
        return error;
  }
@@ -1997,8 +2007,8 @@
        error = user_path_walk_link(path, &nd);
        if (error)
                return error;
--      error = removexattr(nd.path.dentry, name);
-+      error = removexattr(nd.path.dentry, nd.path.mnt, name, NULL);
+-      error = removexattr(nd.path.dentry, name, nd.path.mnt);
++      error = removexattr(nd.path.dentry, name, nd.path.mnt, NULL);
        path_put(&nd.path);
        return error;
  }
@@ -2006,8 +2016,8 @@
                return error;
        dentry = f->f_path.dentry;
        audit_inode(NULL, dentry);
--      error = removexattr(dentry, name);
-+      error = removexattr(dentry, f->f_path.mnt, name, f);
+-      error = removexattr(dentry, name, f->f_vfsmnt);
++      error = removexattr(dentry, name, f->f_path.mnt, f);
        fput(f);
        return error;
  }
@@ -2093,19 +2103,19 @@
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/kernel-apparmor.patch?r1=1.1.2.1&r2=1.1.2.2&f=u

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

Reply via email to