Whamcloud - gitweb
- merge 2 weeks of b1_4 fixes onto HEAD
[fs/lustre-release.git] / lustre / kernel_patches / patches / vfs_nointent-2.6-suse.patch
index 2bd3c6d..934dd77 100644 (file)
@@ -2,11 +2,11 @@
 
 .old..........pc/vfs_nointent_2.6.0-suse/fs/namei.c
 .new.........fs/namei.c
-Index: linux-2.6.4-51.0/fs/namei.c
+Index: linux-2.6.5-12.1/fs/namei.c
 ===================================================================
---- linux-2.6.4-51.0.orig/fs/namei.c   2004-04-05 17:36:42.000000000 -0400
-+++ linux-2.6.4-51.0/fs/namei.c        2004-04-05 17:36:43.000000000 -0400
-@@ -1276,7 +1276,7 @@
+--- linux-2.6.5-12.1.orig/fs/namei.c   2004-05-11 15:41:54.000000000 -0400
++++ linux-2.6.5-12.1/fs/namei.c        2004-05-11 15:42:00.000000000 -0400
+@@ -1292,7 +1292,7 @@
                if (!error) {
                        DQUOT_INIT(inode);
                        
@@ -15,7 +15,7 @@ Index: linux-2.6.4-51.0/fs/namei.c
                }
                put_write_access(inode);
                if (error)
-@@ -1526,6 +1526,7 @@
+@@ -1542,6 +1542,7 @@
        char * tmp;
        struct dentry * dentry;
        struct nameidata nd;
@@ -23,7 +23,7 @@ Index: linux-2.6.4-51.0/fs/namei.c
  
        if (S_ISDIR(mode))
                return -EPERM;
-@@ -1536,6 +1537,15 @@
+@@ -1554,6 +1555,15 @@
        error = path_lookup(tmp, LOOKUP_PARENT, &nd);
        if (error)
                goto out;
@@ -39,7 +39,7 @@ Index: linux-2.6.4-51.0/fs/namei.c
        dentry = lookup_create(&nd, 0);
        error = PTR_ERR(dentry);
  
-@@ -1562,6 +1572,7 @@
+@@ -1580,6 +1590,7 @@
                dput(dentry);
        }
        up(&nd.dentry->d_inode->i_sem);
@@ -47,8 +47,8 @@ Index: linux-2.6.4-51.0/fs/namei.c
        path_release(&nd);
  out:
        putname(tmp);
-@@ -1603,10 +1614,18 @@
-       if (!IS_ERR(tmp)) {
+@@ -1626,10 +1637,18 @@
                struct dentry *dentry;
                struct nameidata nd;
 +                intent_init(&nd.intent, IT_LOOKUP);
@@ -66,15 +66,15 @@ Index: linux-2.6.4-51.0/fs/namei.c
                dentry = lookup_create(&nd, 1);
                error = PTR_ERR(dentry);
                if (!IS_ERR(dentry)) {
-@@ -1616,6 +1635,7 @@
+@@ -1639,6 +1658,7 @@
                        dput(dentry);
                }
                up(&nd.dentry->d_inode->i_sem);
 +out2:
                path_release(&nd);
  out:
-               putname(tmp);
-@@ -1696,6 +1716,7 @@
+@@ -1722,6 +1742,7 @@
        char * name;
        struct dentry *dentry;
        struct nameidata nd;
@@ -82,7 +82,7 @@ Index: linux-2.6.4-51.0/fs/namei.c
  
        name = getname(pathname);
        if(IS_ERR(name))
-@@ -1716,6 +1737,14 @@
+@@ -1744,6 +1765,14 @@
                        error = -EBUSY;
                        goto exit1;
        }
@@ -97,7 +97,7 @@ Index: linux-2.6.4-51.0/fs/namei.c
        down(&nd.dentry->d_inode->i_sem);
        dentry = lookup_hash(&nd.last, nd.dentry);
        error = PTR_ERR(dentry);
-@@ -1774,6 +1805,7 @@
+@@ -1805,6 +1834,7 @@
        struct dentry *dentry;
        struct nameidata nd;
        struct inode *inode = NULL;
@@ -105,7 +105,7 @@ Index: linux-2.6.4-51.0/fs/namei.c
  
        name = getname(pathname);
        if(IS_ERR(name))
-@@ -1785,6 +1817,13 @@
+@@ -1818,6 +1848,13 @@
        error = -EISDIR;
        if (nd.last_type != LAST_NORM)
                goto exit1;
@@ -119,8 +119,8 @@ Index: linux-2.6.4-51.0/fs/namei.c
        down(&nd.dentry->d_inode->i_sem);
        dentry = lookup_hash(&nd.last, nd.dentry);
        error = PTR_ERR(dentry);
-@@ -1852,10 +1891,18 @@
-       if (!IS_ERR(to)) {
+@@ -1891,10 +1928,18 @@
                struct dentry *dentry;
                struct nameidata nd;
 +                intent_init(&nd.intent, IT_LOOKUP);
@@ -138,15 +138,15 @@ Index: linux-2.6.4-51.0/fs/namei.c
                dentry = lookup_create(&nd, 0);
                error = PTR_ERR(dentry);
                if (!IS_ERR(dentry)) {
-@@ -1863,6 +1910,7 @@
+@@ -1902,6 +1947,7 @@
                        dput(dentry);
                }
                up(&nd.dentry->d_inode->i_sem);
 +out2:
                path_release(&nd);
  out:
-               putname(to);
-@@ -1926,6 +1974,8 @@
+@@ -1968,6 +2014,8 @@
        struct nameidata nd, old_nd;
        int error;
        char * to;
@@ -155,7 +155,7 @@ Index: linux-2.6.4-51.0/fs/namei.c
  
        to = getname(newname);
        if (IS_ERR(to))
-@@ -1940,6 +1990,13 @@
+@@ -1986,6 +2034,13 @@
        error = -EXDEV;
        if (old_nd.mnt != nd.mnt)
                goto out_release;
@@ -169,7 +169,7 @@ Index: linux-2.6.4-51.0/fs/namei.c
        new_dentry = lookup_create(&nd, 0);
        error = PTR_ERR(new_dentry);
        if (!IS_ERR(new_dentry)) {
-@@ -1990,7 +2047,7 @@
+@@ -2038,7 +2093,7 @@
   *       locking].
   */
  int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry,
@@ -178,7 +178,7 @@ Index: linux-2.6.4-51.0/fs/namei.c
  {
        int error = 0;
        struct inode *target;
-@@ -2035,7 +2092,7 @@
+@@ -2083,7 +2138,7 @@
  }
  
  int vfs_rename_other(struct inode *old_dir, struct dentry *old_dentry,
@@ -187,7 +187,7 @@ Index: linux-2.6.4-51.0/fs/namei.c
  {
        struct inode *target;
        int error;
-@@ -2112,6 +2169,8 @@
+@@ -2160,6 +2215,8 @@
        struct dentry * old_dentry, *new_dentry;
        struct dentry * trap;
        struct nameidata oldnd, newnd;
@@ -196,7 +196,7 @@ Index: linux-2.6.4-51.0/fs/namei.c
  
        error = path_lookup(oldname, LOOKUP_PARENT, &oldnd);
        if (error)
-@@ -2134,6 +2193,13 @@
+@@ -2182,6 +2239,13 @@
        if (newnd.last_type != LAST_NORM)
                goto exit2;
  
@@ -210,7 +210,7 @@ Index: linux-2.6.4-51.0/fs/namei.c
        trap = lock_rename(new_dir, old_dir);
  
        old_dentry = lookup_hash(&oldnd.last, old_dir);
-@@ -2165,8 +2231,7 @@
+@@ -2213,8 +2277,7 @@
        if (new_dentry == trap)
                goto exit5;
  
@@ -220,11 +220,11 @@ Index: linux-2.6.4-51.0/fs/namei.c
  exit5:
        dput(new_dentry);
  exit4:
-Index: linux-2.6.4-51.0/fs/open.c
+Index: linux-2.6.5-12.1/fs/open.c
 ===================================================================
---- linux-2.6.4-51.0.orig/fs/open.c    2004-04-05 17:36:42.000000000 -0400
-+++ linux-2.6.4-51.0/fs/open.c 2004-04-06 01:37:39.000000000 -0400
-@@ -187,9 +187,10 @@
+--- linux-2.6.5-12.1.orig/fs/open.c    2004-05-11 15:41:54.000000000 -0400
++++ linux-2.6.5-12.1/fs/open.c 2004-05-11 16:07:02.000000000 -0400
+@@ -203,9 +203,10 @@
        return error;
  }
  
@@ -236,7 +236,7 @@ Index: linux-2.6.4-51.0/fs/open.c
        struct iattr newattrs;
  
        /* Not pretty: "inode->i_size" shouldn't really be signed. But it is. */
-@@ -200,7 +201,14 @@
+@@ -216,7 +217,14 @@
        newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME;
        down(&dentry->d_inode->i_sem);
        down_write(&dentry->d_inode->i_alloc_sem);
@@ -252,7 +252,7 @@ Index: linux-2.6.4-51.0/fs/open.c
        up_write(&dentry->d_inode->i_alloc_sem);
        up(&dentry->d_inode->i_sem);
        return err;
-@@ -256,7 +264,7 @@
+@@ -271,7 +279,7 @@
        error = locks_verify_truncate(inode, NULL, length);
        if (!error) {
                DQUOT_INIT(inode);
@@ -261,7 +261,7 @@ Index: linux-2.6.4-51.0/fs/open.c
        }
        put_write_access(inode);
  
-@@ -308,7 +316,7 @@
+@@ -328,7 +336,7 @@
  
        error = locks_verify_truncate(inode, file, length);
        if (!error)
@@ -270,30 +270,7 @@ Index: linux-2.6.4-51.0/fs/open.c
  out_putf:
        fput(file);
  out:
-@@ -387,9 +395,19 @@
-                   (error = permission(inode,MAY_WRITE,&nd)) != 0)
-                       goto dput_and_out;
-       }
--      down(&inode->i_sem);
--      error = notify_change(nd.dentry, &newattrs);
--      up(&inode->i_sem);
-+      if (inode->i_op->setattr_raw) {
-+              struct inode_operations *op = nd.dentry->d_inode->i_op;
-+
-+              newattrs.ia_valid |= ATTR_RAW;
-+              error = op->setattr_raw(inode, &newattrs);
-+              /* the file system wants to use normal vfs path now */
-+              if (error != -EOPNOTSUPP)
-+                      goto dput_and_out;
-+      } else {
-+                down(&inode->i_sem);
-+                error = notify_change(nd.dentry, &newattrs);
-+                up(&inode->i_sem);
-+        }
- dput_and_out:
-       path_release(&nd);
- out:
-@@ -440,9 +458,19 @@
+@@ -402,9 +410,19 @@
                    (error = permission(inode,MAY_WRITE,&nd)) != 0)
                        goto dput_and_out;
        }
@@ -315,8 +292,8 @@ Index: linux-2.6.4-51.0/fs/open.c
 +        }
  dput_and_out:
        path_release(&nd);
- out:
-@@ -592,36 +620,52 @@
+@@ -613,39 +631,55 @@
        return error;
  }
  
@@ -326,11 +303,14 @@ Index: linux-2.6.4-51.0/fs/open.c
 -      struct inode * inode;
 -      struct dentry * dentry;
 -      struct file * file;
--      int err = -EBADF;
+-      int err;
 +      struct inode * inode = dentry->d_inode;
        struct iattr newattrs;
 +      int error = -EROFS;
  
+-      FSHOOK_BEGIN(fchmod, err, .fd = fd, .mode = mode)
+-
+-      err = -EBADF;
 -      file = fget(fd);
 -      if (!file)
 +      if (IS_RDONLY(inode))
@@ -338,18 +318,19 @@ Index: linux-2.6.4-51.0/fs/open.c
 +      
 +      if (inode->i_op->setattr_raw) {
 +              struct inode_operations *op = dentry->d_inode->i_op;
--      dentry = file->f_dentry;
--      inode = dentry->d_inode;
++              
 +              newattrs.ia_mode = mode;
 +              newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
 +              newattrs.ia_valid |= ATTR_RAW;
 +              error = op->setattr_raw(inode, &newattrs);
-+              /* the file system wants to use normal vfs path now */
++              /* the file system wants to use the normal vfs path now */
 +              if (error != -EOPNOTSUPP)
 +                      goto out;
 +      }
  
+-      dentry = file->f_dentry;
+-      inode = dentry->d_inode;
+-
 -      err = -EROFS;
 -      if (IS_RDONLY(inode))
 -              goto out_putf;
@@ -367,16 +348,19 @@ Index: linux-2.6.4-51.0/fs/open.c
 -      err = notify_change(dentry, &newattrs);
 +      error = notify_change(dentry, &newattrs);
        up(&inode->i_sem);
+-out_putf:
 +out:
 +      return error;
 +}
--out_putf:
++
 +asmlinkage long sys_fchmod(unsigned int fd, mode_t mode)
 +{
 +      struct file * file;
 +      int err = -EBADF;
 +
++      FSHOOK_BEGIN(fchmod, err, .fd = fd, .mode = mode)
++
 +      file = fget(fd);
 +      if (!file)
 +              goto out;
@@ -384,8 +368,8 @@ Index: linux-2.6.4-51.0/fs/open.c
 +      err = chmod_common(file->f_dentry, mode);
        fput(file);
  out:
-       return err;
-@@ -630,32 +674,13 @@
+@@ -657,9 +691,7 @@
  asmlinkage long sys_chmod(const char __user * filename, mode_t mode)
  {
        struct nameidata nd;
@@ -393,9 +377,12 @@ Index: linux-2.6.4-51.0/fs/open.c
        int error;
 -      struct iattr newattrs;
  
-       error = user_path_walk(filename, &nd);
-       if (error)
-               goto out;
+       FSHOOK_BEGIN_USER_PATH_WALK(chmod,
+               error,
+@@ -669,25 +701,7 @@
+               .mode = mode,
+               .link = false)
 -      inode = nd.dentry->d_inode;
 -
 -      error = -EROFS;
@@ -413,13 +400,13 @@ Index: linux-2.6.4-51.0/fs/open.c
 -      newattrs.ia_valid = ATTR_MODE | ATTR_CTIME;
 -      error = notify_change(nd.dentry, &newattrs);
 -      up(&inode->i_sem);
+-
 -dput_and_out:
 +      error = chmod_common(nd.dentry, mode);
        path_release(&nd);
- out:
-       return error;
-@@ -676,6 +701,18 @@
+       FSHOOK_END_USER_WALK(chmod, error, path)
+@@ -710,6 +724,18 @@
        if (IS_RDONLY(inode))
                goto out;
        error = -EPERM;
@@ -438,7 +425,7 @@ Index: linux-2.6.4-51.0/fs/open.c
        if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
                goto out;
        newattrs.ia_valid =  ATTR_CTIME;
-@@ -689,6 +726,7 @@
+@@ -723,6 +749,7 @@
        }
        if (!S_ISDIR(inode->i_mode))
                newattrs.ia_valid |= ATTR_KILL_SUID|ATTR_KILL_SGID;
@@ -446,11 +433,11 @@ Index: linux-2.6.4-51.0/fs/open.c
        down(&inode->i_sem);
        error = notify_change(dentry, &newattrs);
        up(&inode->i_sem);
-Index: linux-2.6.4-51.0/fs/exec.c
+Index: linux-2.6.5-12.1/fs/exec.c
 ===================================================================
---- linux-2.6.4-51.0.orig/fs/exec.c    2004-04-05 17:36:42.000000000 -0400
-+++ linux-2.6.4-51.0/fs/exec.c 2004-04-05 17:36:43.000000000 -0400
-@@ -1418,7 +1418,7 @@
+--- linux-2.6.5-12.1.orig/fs/exec.c    2004-05-11 15:41:54.000000000 -0400
++++ linux-2.6.5-12.1/fs/exec.c 2004-05-11 15:42:00.000000000 -0400
+@@ -1435,7 +1435,7 @@
                goto close_fail;
        if (!file->f_op->write)
                goto close_fail;
@@ -459,11 +446,11 @@ Index: linux-2.6.4-51.0/fs/exec.c
                goto close_fail;
  
        retval = binfmt->core_dump(signr, regs, file);
-Index: linux-2.6.4-51.0/include/linux/fs.h
+Index: linux-2.6.5-12.1/include/linux/fs.h
 ===================================================================
---- linux-2.6.4-51.0.orig/include/linux/fs.h   2004-04-05 17:36:43.000000000 -0400
-+++ linux-2.6.4-51.0/include/linux/fs.h        2004-04-05 17:36:43.000000000 -0400
-@@ -866,13 +866,20 @@
+--- linux-2.6.5-12.1.orig/include/linux/fs.h   2004-05-11 15:41:54.000000000 -0400
++++ linux-2.6.5-12.1/include/linux/fs.h        2004-05-11 15:42:00.000000000 -0400
+@@ -878,13 +878,20 @@
        int (*create) (struct inode *,struct dentry *,int, struct nameidata *);
        struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *);
        int (*link) (struct dentry *,struct inode *,struct dentry *);
@@ -484,7 +471,7 @@ Index: linux-2.6.4-51.0/include/linux/fs.h
        int (*readlink) (struct dentry *, char __user *,int);
        int (*follow_link) (struct dentry *, struct nameidata *);
        void (*truncate) (struct inode *);
-@@ -1169,7 +1176,7 @@
+@@ -1182,7 +1189,7 @@
  
  /* fs/open.c */
  
@@ -493,10 +480,10 @@ Index: linux-2.6.4-51.0/include/linux/fs.h
  extern struct file *filp_open(const char *, int, int);
  extern struct file * dentry_open(struct dentry *, struct vfsmount *, int);
  extern struct file * dentry_open_it(struct dentry *, struct vfsmount *, int, struct lookup_intent *);
-Index: linux-2.6.4-51.0/net/unix/af_unix.c
+Index: linux-2.6.5-12.1/net/unix/af_unix.c
 ===================================================================
---- linux-2.6.4-51.0.orig/net/unix/af_unix.c   2004-04-05 12:42:07.000000000 -0400
-+++ linux-2.6.4-51.0/net/unix/af_unix.c        2004-04-05 17:36:43.000000000 -0400
+--- linux-2.6.5-12.1.orig/net/unix/af_unix.c   2004-04-03 22:37:36.000000000 -0500
++++ linux-2.6.5-12.1/net/unix/af_unix.c        2004-05-11 15:42:00.000000000 -0400
 @@ -676,6 +676,7 @@
        int err = 0;