Whamcloud - gitweb
update .snap on smfs
[fs/lustre-release.git] / lustre / kernel_patches / patches / vfs_intent-2.4.21-suse2.patch
index 1e78f10..dc34bb0 100644 (file)
  kernel/ksyms.c            |    1 
  12 files changed, 558 insertions(+), 128 deletions(-)
 
-Index: linux-2.4.21-suse2/fs/dcache.c
+Index: kernel-2.4.212lgns/fs/dcache.c
 ===================================================================
---- linux-2.4.21-suse2.orig/fs/dcache.c        2003-10-28 21:33:59.000000000 +0300
-+++ linux-2.4.21-suse2/fs/dcache.c     2004-01-10 12:15:41.000000000 +0300
+--- kernel-2.4.212lgns.orig/fs/dcache.c        2003-10-28 10:33:59.000000000 -0800
++++ kernel-2.4.212lgns/fs/dcache.c     2004-05-11 06:41:10.000000000 -0700
 @@ -186,6 +186,13 @@
                spin_unlock(&dcache_lock);
                return 0;
@@ -53,10 +53,10 @@ Index: linux-2.4.21-suse2/fs/dcache.c
  }
  
  #define do_switch(x,y) do { \
-Index: linux-2.4.21-suse2/fs/exec.c
+Index: kernel-2.4.212lgns/fs/exec.c
 ===================================================================
---- linux-2.4.21-suse2.orig/fs/exec.c  2003-10-28 21:34:17.000000000 +0300
-+++ linux-2.4.21-suse2/fs/exec.c       2004-01-10 12:15:41.000000000 +0300
+--- kernel-2.4.212lgns.orig/fs/exec.c  2003-10-28 10:34:17.000000000 -0800
++++ kernel-2.4.212lgns/fs/exec.c       2004-05-11 06:41:10.000000000 -0700
 @@ -112,8 +112,10 @@
        struct file * file;
        struct nameidata nd;
@@ -118,10 +118,10 @@ Index: linux-2.4.21-suse2/fs/exec.c
                goto close_fail;
  
        retval = binfmt->core_dump(signr, regs, file);
-Index: linux-2.4.21-suse2/fs/namei.c
+Index: kernel-2.4.212lgns/fs/namei.c
 ===================================================================
---- linux-2.4.21-suse2.orig/fs/namei.c 2004-01-10 12:06:40.000000000 +0300
-+++ linux-2.4.21-suse2/fs/namei.c      2004-01-10 12:55:09.000000000 +0300
+--- kernel-2.4.212lgns.orig/fs/namei.c 2003-10-28 10:34:18.000000000 -0800
++++ kernel-2.4.212lgns/fs/namei.c      2004-05-11 06:41:10.000000000 -0700
 @@ -94,6 +94,13 @@
   * XEmacs seems to be relying on it...
   */
@@ -147,7 +147,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
        struct dentry * dentry = d_lookup(parent, name);
  
 +      if (dentry && dentry->d_op && dentry->d_op->d_revalidate_it) {
-+              if (!dentry->d_op->d_revalidate_it(dentry, flags, it) &&
++              if (!dentry->d_op->d_revalidate_it(dentry, flags, NULL, it) &&
 +                  !d_invalidate(dentry)) {
 +                      dput(dentry);
 +                      dentry = NULL;
@@ -179,7 +179,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
                if (dentry) {
                        lock_kernel();
 +                      if (dir->i_op->lookup_it)
-+                              result = dir->i_op->lookup_it(dir, dentry, it, flags);
++                              result = dir->i_op->lookup_it(dir, dentry, NULL, it, flags);
 +                      else
                        result = dir->i_op->lookup(dir, dentry);
                        unlock_kernel();
@@ -189,7 +189,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
                        result = ERR_PTR(-ENOENT);
                }
 +      } else if (result->d_op && result->d_op->d_revalidate_it) {
-+              if (!result->d_op->d_revalidate_it(result, flags, it) &&
++              if (!result->d_op->d_revalidate_it(result, flags, NULL, it) &&
 +                  !d_invalidate(result)) {
 +                      dput(result);
 +                      if (counter > 10)
@@ -300,42 +300,44 @@ Index: linux-2.4.21-suse2/fs/namei.c
                                break;
                }
                goto return_base;
-@@ -643,6 +680,25 @@
+@@ -643,6 +680,27 @@
                 * Check the cached dentry for staleness.
                 */
                dentry = nd->dentry;
 +              if (dentry && dentry->d_op && dentry->d_op->d_revalidate_it) {
 +                      err = -ESTALE;
-+                      if (!dentry->d_op->d_revalidate_it(dentry, 0, it)) {
++                      if (!dentry->d_op->d_revalidate_it(dentry, 0, NULL, it)) {
 +                              struct dentry *new;
 +                              err = permission(dentry->d_parent->d_inode,
-+                                              MAY_EXEC);
++                                               MAY_EXEC);
 +                              if (err)
 +                                      break;
 +                              new = real_lookup(dentry->d_parent,
-+                                              &dentry->d_name, 0, NULL);
-+                              d_invalidate(dentry);
-+                              dput(dentry);
-+                              if (IS_ERR(new)) { 
++                                                &dentry->d_name, 0, it);
++                              if (IS_ERR(new)) {
 +                                      err = PTR_ERR(new);
 +                                      break;
 +                              }
++                              d_invalidate(dentry);
++                              dput(dentry);
 +                              nd->dentry = new;
 +                      }
++                      if (!nd->dentry->d_inode)
++                              goto no_inode;
 +              } else
                if (dentry && dentry->d_op && dentry->d_op->d_revalidate) {
                        err = -ESTALE;
                        if (!dentry->d_op->d_revalidate(dentry, lookup_flags & LOOKUP_PARENT)) {
-@@ -656,6 +712,8 @@
+@@ -656,6 +714,8 @@
                dput(dentry);
                break;
        }
-+      if (err)
-+              intent_release(it);
++      if (err)
++              intent_release(it);
        path_release(nd);
  return_err:
        return err;
-@@ -663,13 +721,13 @@
+@@ -663,13 +723,13 @@
  
  int link_path_walk(const char * name, struct nameidata *nd)
  {
@@ -351,7 +353,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
  }
  
  int path_walk(const char * name, struct nameidata *nd)
-@@ -677,6 +735,12 @@
+@@ -677,6 +737,12 @@
        return __path_walk(name, nd);
  }
  
@@ -364,7 +366,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
  /* SMP-safe */
  /* returns 1 if everything is done */
  static int __emul_lookup_dentry(const char *name, struct nameidata *nd)
-@@ -759,6 +823,17 @@
+@@ -759,6 +825,17 @@
  }
  
  /* SMP-safe */
@@ -382,7 +384,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
  int path_lookup(const char *path, unsigned flags, struct nameidata *nd)
  {
        int error = 0;
-@@ -773,6 +848,7 @@
+@@ -773,6 +850,7 @@
  {
        nd->last_type = LAST_ROOT; /* if there are only slashes... */
        nd->flags = flags;
@@ -390,7 +392,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
        if (*name=='/')
                return walk_init_root(name,nd);
        read_lock(&current->fs->lock);
-@@ -787,7 +863,8 @@
+@@ -787,7 +865,8 @@
   * needs parent already locked. Doesn't follow mounts.
   * SMP-safe.
   */
@@ -400,7 +402,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
  {
        struct dentry * dentry;
        struct inode *inode;
-@@ -810,13 +887,16 @@
+@@ -810,13 +889,16 @@
                        goto out;
        }
  
@@ -413,12 +415,12 @@ Index: linux-2.4.21-suse2/fs/namei.c
                        goto out;
                lock_kernel();
 +              if (inode->i_op->lookup_it)
-+                      dentry = inode->i_op->lookup_it(inode, new, it, 0);
++                      dentry = inode->i_op->lookup_it(inode, new, NULL, it, 0);
 +              else
                dentry = inode->i_op->lookup(inode, new);
                unlock_kernel();
                if (!dentry)
-@@ -828,6 +908,12 @@
+@@ -828,6 +910,12 @@
        return dentry;
  }
  
@@ -431,7 +433,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
  /* SMP-safe */
  struct dentry * lookup_one_len(const char * name, struct dentry * base, int len)
  {
-@@ -849,7 +935,7 @@
+@@ -849,7 +937,7 @@
        }
        this.hash = end_name_hash(hash);
  
@@ -440,7 +442,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
  access:
        return ERR_PTR(-EACCES);
  }
-@@ -880,6 +966,23 @@
+@@ -880,6 +968,23 @@
        return err;
  }
  
@@ -464,7 +466,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
  /*
   * It's inline, so penalty for filesystems that don't use sticky bit is
   * minimal.
-@@ -977,7 +1080,8 @@
+@@ -977,7 +1082,8 @@
        return retval;
  }
  
@@ -474,7 +476,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
  {
        int error;
  
-@@ -990,12 +1094,15 @@
+@@ -990,12 +1096,15 @@
                goto exit_lock;
  
        error = -EACCES;        /* shouldn't it be ENOSYS? */
@@ -492,7 +494,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
        unlock_kernel();
  exit_lock:
        up(&dir->i_zombie);
-@@ -1004,6 +1111,11 @@
+@@ -1004,6 +1113,11 @@
        return error;
  }
  
@@ -504,7 +506,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
  /*
   *    open_namei()
   *
-@@ -1018,7 +1130,8 @@
+@@ -1018,7 +1132,8 @@
   * for symlinks (where the permissions are checked later).
   * SMP-safe
   */
@@ -514,7 +516,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
  {
        int acc_mode, error = 0;
        struct inode *inode;
-@@ -1028,11 +1141,14 @@
+@@ -1028,11 +1143,14 @@
  
        acc_mode = ACC_MODE(flag);
  
@@ -530,7 +532,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
                if (error)
                        return error;
                dentry = nd->dentry;
-@@ -1042,6 +1158,10 @@
+@@ -1042,6 +1160,10 @@
        /*
         * Create - we need to know the parent.
         */
@@ -541,7 +543,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
        error = path_lookup(pathname, LOOKUP_PARENT, nd);
        if (error)
                return error;
-@@ -1057,7 +1177,7 @@
+@@ -1057,7 +1179,7 @@
  
        dir = nd->dentry;
        down(&dir->d_inode->i_sem);
@@ -550,7 +552,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
  
  do_last:
        error = PTR_ERR(dentry);
-@@ -1066,11 +1186,12 @@
+@@ -1066,11 +1188,12 @@
                goto exit;
        }
  
@@ -564,7 +566,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
                up(&dir->d_inode->i_sem);
  #ifndef DENTRY_WASTE_RAM
                if (error)
-@@ -1178,7 +1299,7 @@
+@@ -1178,7 +1301,7 @@
                if (!error) {
                        DQUOT_INIT(inode);
                        
@@ -573,7 +575,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
                }
                put_write_access(inode);
                if (error)
-@@ -1190,8 +1311,10 @@
+@@ -1190,8 +1313,10 @@
        return 0;
  
  exit_dput:
@@ -584,7 +586,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
        path_release(nd);
        return error;
  
-@@ -1210,7 +1333,10 @@
+@@ -1210,7 +1335,10 @@
         * are done. Procfs-like symlinks just set LAST_BIND.
         */
        UPDATE_ATIME(dentry->d_inode);
@@ -595,7 +597,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
        dput(dentry);
        if (error)
                return error;
-@@ -1232,13 +1358,20 @@
+@@ -1232,13 +1360,20 @@
        }
        dir = nd->dentry;
        down(&dir->d_inode->i_sem);
@@ -618,7 +620,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
  {
        struct dentry *dentry;
  
-@@ -1246,7 +1379,7 @@
+@@ -1246,7 +1381,7 @@
        dentry = ERR_PTR(-EEXIST);
        if (nd->last_type != LAST_NORM)
                goto fail;
@@ -627,12 +629,16 @@ Index: linux-2.4.21-suse2/fs/namei.c
        if (IS_ERR(dentry))
                goto fail;
        if (!is_dir && nd->last.name[nd->last.len] && !dentry->d_inode)
-@@ -1302,7 +1435,16 @@
+@@ -1302,7 +1437,20 @@
        error = path_lookup(tmp, LOOKUP_PARENT, &nd);
        if (error)
                goto out;
 -      dentry = lookup_create(&nd, 0);
 +
++      if (nd.last_type != LAST_NORM) {
++              error = -EEXIST;
++              goto out2;
++      }
 +      if (nd.dentry->d_inode->i_op->mknod_raw) {
 +              struct inode_operations *op = nd.dentry->d_inode->i_op;
 +              error = op->mknod_raw(&nd, mode, dev);
@@ -645,7 +651,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
        error = PTR_ERR(dentry);
  
        if (!IS_POSIXACL(nd.dentry->d_inode))
-@@ -1324,6 +1466,7 @@
+@@ -1324,6 +1472,7 @@
                dput(dentry);
        }
        up(&nd.dentry->d_inode->i_sem);
@@ -653,11 +659,15 @@ Index: linux-2.4.21-suse2/fs/namei.c
        path_release(&nd);
  out:
        putname(tmp);
-@@ -1371,7 +1514,14 @@
+@@ -1371,7 +1520,18 @@
                error = path_lookup(tmp, LOOKUP_PARENT, &nd);
                if (error)
                        goto out;
 -              dentry = lookup_create(&nd, 1);
++              if (nd.last_type != LAST_NORM) {
++                      error = -EEXIST;
++                      goto out2;
++              }
 +              if (nd.dentry->d_inode->i_op->mkdir_raw) {
 +                      struct inode_operations *op = nd.dentry->d_inode->i_op;
 +                      error = op->mkdir_raw(&nd, mode);
@@ -669,7 +679,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
                error = PTR_ERR(dentry);
                if (!IS_ERR(dentry)) {
                        if (!IS_POSIXACL(nd.dentry->d_inode))
-@@ -1380,6 +1530,7 @@
+@@ -1380,6 +1540,7 @@
                        dput(dentry);
                }
                up(&nd.dentry->d_inode->i_sem);
@@ -677,7 +687,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
                path_release(&nd);
  out:
                putname(tmp);
-@@ -1480,8 +1631,16 @@
+@@ -1480,8 +1641,16 @@
                        error = -EBUSY;
                        goto exit1;
        }
@@ -695,7 +705,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
        error = PTR_ERR(dentry);
        if (!IS_ERR(dentry)) {
                error = vfs_rmdir(nd.dentry->d_inode, dentry);
-@@ -1539,8 +1698,15 @@
+@@ -1539,8 +1708,15 @@
        error = -EISDIR;
        if (nd.last_type != LAST_NORM)
                goto exit1;
@@ -712,11 +722,15 @@ Index: linux-2.4.21-suse2/fs/namei.c
        error = PTR_ERR(dentry);
        if (!IS_ERR(dentry)) {
                /* Why not before? Because we want correct error value */
-@@ -1607,15 +1773,23 @@
+@@ -1607,15 +1783,27 @@
                error = path_lookup(to, LOOKUP_PARENT, &nd);
                if (error)
                        goto out;
 -              dentry = lookup_create(&nd, 0);
++              if (nd.last_type != LAST_NORM) {
++                      error = -EEXIST;
++                      goto out2;
++              }
 +              if (nd.dentry->d_inode->i_op->symlink_raw) {
 +                      struct inode_operations *op = nd.dentry->d_inode->i_op;
 +                      error = op->symlink_raw(&nd, from);
@@ -738,11 +752,15 @@ Index: linux-2.4.21-suse2/fs/namei.c
                putname(to);
        }
        putname(from);
-@@ -1691,7 +1865,14 @@
+@@ -1691,7 +1879,18 @@
                error = -EXDEV;
                if (old_nd.mnt != nd.mnt)
                        goto out_release;
 -              new_dentry = lookup_create(&nd, 0);
++              if (nd.last_type != LAST_NORM) {
++                      error = -EEXIST;
++                      goto out_release;
++              }
 +              if (nd.dentry->d_inode->i_op->link_raw) {
 +                      struct inode_operations *op = nd.dentry->d_inode->i_op;
 +                      error = op->link_raw(&old_nd, &nd);
@@ -754,7 +772,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
                error = PTR_ERR(new_dentry);
                if (!IS_ERR(new_dentry)) {
                        error = vfs_link(old_nd.dentry, nd.dentry->d_inode, new_dentry);
-@@ -1735,7 +1916,7 @@
+@@ -1735,7 +1934,7 @@
   *       locking].
   */
  int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry,
@@ -763,7 +781,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
  {
        int error;
        struct inode *target;
-@@ -1814,7 +1995,7 @@
+@@ -1814,7 +2013,7 @@
  }
  
  int vfs_rename_other(struct inode *old_dir, struct dentry *old_dentry,
@@ -772,7 +790,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
  {
        int error;
  
-@@ -1902,9 +2083,18 @@
+@@ -1902,9 +2101,18 @@
        if (newnd.last_type != LAST_NORM)
                goto exit2;
  
@@ -792,7 +810,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
        error = PTR_ERR(old_dentry);
        if (IS_ERR(old_dentry))
                goto exit3;
-@@ -1920,16 +2110,16 @@
+@@ -1920,16 +2128,16 @@
                if (newnd.last.name[newnd.last.len])
                        goto exit4;
        }
@@ -811,7 +829,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
        dput(new_dentry);
  exit4:
        dput(old_dentry);
-@@ -1980,20 +2170,26 @@
+@@ -1980,20 +2188,26 @@
  }
  
  static inline int
@@ -840,7 +858,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
  out:
        if (current->link_count || res || nd->last_type!=LAST_NORM)
                return res;
-@@ -2017,7 +2213,13 @@
+@@ -2017,7 +2231,13 @@
  
  int vfs_follow_link(struct nameidata *nd, const char *link)
  {
@@ -855,7 +873,7 @@ Index: linux-2.4.21-suse2/fs/namei.c
  }
  
  /* get the link contents into pagecache */
-@@ -2059,7 +2261,7 @@
+@@ -2059,7 +2279,7 @@
  {
        struct page *page = NULL;
        char *s = page_getlink(dentry, &page);
@@ -864,10 +882,10 @@ Index: linux-2.4.21-suse2/fs/namei.c
        if (page) {
                kunmap(page);
                page_cache_release(page);
-Index: linux-2.4.21-suse2/fs/namespace.c
+Index: kernel-2.4.212lgns/fs/namespace.c
 ===================================================================
---- linux-2.4.21-suse2.orig/fs/namespace.c     2003-10-28 21:34:12.000000000 +0300
-+++ linux-2.4.21-suse2/fs/namespace.c  2004-01-10 12:15:41.000000000 +0300
+--- kernel-2.4.212lgns.orig/fs/namespace.c     2003-10-28 10:34:12.000000000 -0800
++++ kernel-2.4.212lgns/fs/namespace.c  2004-05-11 06:41:10.000000000 -0700
 @@ -98,6 +98,7 @@
  {
        old_nd->dentry = mnt->mnt_mountpoint;
@@ -884,6 +902,15 @@ Index: linux-2.4.21-suse2/fs/namespace.c
        list_add(&mnt->mnt_hash, mount_hashtable+hash(nd->mnt, nd->dentry));
        list_add(&mnt->mnt_child, &nd->mnt->mnt_mounts);
        nd->dentry->d_mounted++;
+@@ -286,7 +288,7 @@
+       }
+ }
+-static int do_umount(struct vfsmount *mnt, int flags)
++int do_umount(struct vfsmount *mnt, int flags)
+ {
+       struct super_block * sb = mnt->mnt_sb;
+       int retval = 0;
 @@ -488,14 +490,17 @@
  {
        struct nameidata old_nd;
@@ -920,7 +947,7 @@ Index: linux-2.4.21-suse2/fs/namespace.c
        int retval = 0;
        int mnt_flags = 0;
  
-@@ -725,10 +732,11 @@
+@@ -725,9 +732,11 @@
        flags &= ~(MS_NOSUID|MS_NOEXEC|MS_NODEV);
  
        /* ... and get the mountpoint */
@@ -930,12 +957,11 @@ Index: linux-2.4.21-suse2/fs/namespace.c
 +      if (retval) {
 +              intent_release(&it);
                return retval;
--
 +      }
        if (flags & MS_REMOUNT)
                retval = do_remount(&nd, flags & ~MS_REMOUNT, mnt_flags,
-                                   data_page);
-@@ -739,6 +747,8 @@
+@@ -739,6 +748,8 @@
        else
                retval = do_add_mount(&nd, type_page, flags, mnt_flags,
                                      dev_name, data_page);
@@ -944,7 +970,7 @@ Index: linux-2.4.21-suse2/fs/namespace.c
        path_release(&nd);
        return retval;
  }
-@@ -904,6 +914,8 @@
+@@ -904,6 +915,8 @@
  {
        struct vfsmount *tmp;
        struct nameidata new_nd, old_nd, parent_nd, root_parent, user_nd;
@@ -953,7 +979,7 @@ Index: linux-2.4.21-suse2/fs/namespace.c
        int error;
  
        if (!capable(CAP_SYS_ADMIN))
-@@ -911,14 +923,14 @@
+@@ -911,14 +924,14 @@
  
        lock_kernel();
  
@@ -970,7 +996,7 @@ Index: linux-2.4.21-suse2/fs/namespace.c
        if (error)
                goto out1;
  
-@@ -973,8 +985,10 @@
+@@ -973,8 +986,10 @@
        up(&old_nd.dentry->d_inode->i_zombie);
        up_write(&current->namespace->sem);
        path_release(&user_nd);
@@ -981,10 +1007,10 @@ Index: linux-2.4.21-suse2/fs/namespace.c
        path_release(&new_nd);
  out0:
        unlock_kernel();
-Index: linux-2.4.21-suse2/fs/open.c
+Index: kernel-2.4.212lgns/fs/open.c
 ===================================================================
---- linux-2.4.21-suse2.orig/fs/open.c  2003-10-28 21:33:59.000000000 +0300
-+++ linux-2.4.21-suse2/fs/open.c       2004-01-10 12:55:39.000000000 +0300
+--- kernel-2.4.212lgns.orig/fs/open.c  2003-10-28 10:33:59.000000000 -0800
++++ kernel-2.4.212lgns/fs/open.c       2004-05-11 06:41:10.000000000 -0700
 @@ -19,6 +19,8 @@
  #include <asm/uaccess.h>
  
@@ -1192,7 +1218,7 @@ Index: linux-2.4.21-suse2/fs/open.c
 -      error = __user_walk(filename, LOOKUP_POSITIVE | LOOKUP_FOLLOW |
 -                    LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd);
 +      error = __user_walk_it(filename, LOOKUP_POSITIVE | LOOKUP_FOLLOW |
-+                    LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd, &it);
++                             LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd, &it);
        if (error)
                goto out;
  
@@ -1385,11 +1411,11 @@ Index: linux-2.4.21-suse2/fs/open.c
  /*
   * Find an empty file descriptor entry, and mark it busy.
   */
-Index: linux-2.4.21-suse2/fs/stat.c
+Index: kernel-2.4.212lgns/fs/stat.c
 ===================================================================
---- linux-2.4.21-suse2.orig/fs/stat.c  2003-10-28 21:33:58.000000000 +0300
-+++ linux-2.4.21-suse2/fs/stat.c       2004-01-10 12:15:41.000000000 +0300
-@@ -17,10 +17,14 @@
+--- kernel-2.4.212lgns.orig/fs/stat.c  2003-10-28 10:33:58.000000000 -0800
++++ kernel-2.4.212lgns/fs/stat.c       2004-05-11 06:41:10.000000000 -0700
+@@ -17,10 +17,12 @@
   * Revalidate the inode. This is required for proper NFS attribute caching.
   */
  static __inline__ int
@@ -1398,15 +1424,13 @@ Index: linux-2.4.21-suse2/fs/stat.c
  {
        struct inode * inode = dentry->d_inode;
 -      if (inode->i_op && inode->i_op->revalidate)
-+        if (!inode)
-+                return -ENOENT;
 +      if (inode->i_op && inode->i_op->revalidate_it)
 +              return inode->i_op->revalidate_it(dentry, it);
 +      else if (inode->i_op && inode->i_op->revalidate)
                return inode->i_op->revalidate(dentry);
        return 0;
  }
-@@ -141,13 +145,15 @@
+@@ -141,13 +143,15 @@
  asmlinkage long sys_stat(char * filename, struct __old_kernel_stat * statbuf)
  {
        struct nameidata nd;
@@ -1424,7 +1448,7 @@ Index: linux-2.4.21-suse2/fs/stat.c
                path_release(&nd);
        }
        return error;
-@@ -157,13 +163,15 @@
+@@ -157,13 +161,15 @@
  asmlinkage long sys_newstat(char * filename, struct stat * statbuf)
  {
        struct nameidata nd;
@@ -1442,7 +1466,7 @@ Index: linux-2.4.21-suse2/fs/stat.c
                path_release(&nd);
        }
        return error;
-@@ -178,13 +186,15 @@
+@@ -178,13 +184,15 @@
  asmlinkage long sys_lstat(char * filename, struct __old_kernel_stat * statbuf)
  {
        struct nameidata nd;
@@ -1460,7 +1484,7 @@ Index: linux-2.4.21-suse2/fs/stat.c
                path_release(&nd);
        }
        return error;
-@@ -195,13 +205,15 @@
+@@ -195,13 +203,15 @@
  asmlinkage long sys_newlstat(char * filename, struct stat * statbuf)
  {
        struct nameidata nd;
@@ -1478,7 +1502,7 @@ Index: linux-2.4.21-suse2/fs/stat.c
                path_release(&nd);
        }
        return error;
-@@ -222,7 +234,7 @@
+@@ -222,7 +232,7 @@
        if (f) {
                struct dentry * dentry = f->f_dentry;
  
@@ -1487,7 +1511,7 @@ Index: linux-2.4.21-suse2/fs/stat.c
                if (!err)
                        err = cp_old_stat(dentry->d_inode, statbuf);
                fput(f);
-@@ -241,7 +253,7 @@
+@@ -241,7 +251,7 @@
        if (f) {
                struct dentry * dentry = f->f_dentry;
  
@@ -1496,7 +1520,7 @@ Index: linux-2.4.21-suse2/fs/stat.c
                if (!err)
                        err = cp_new_stat(dentry->d_inode, statbuf);
                fput(f);
-@@ -263,7 +275,7 @@
+@@ -263,7 +273,7 @@
  
                error = -EINVAL;
                if (inode->i_op && inode->i_op->readlink &&
@@ -1505,7 +1529,7 @@ Index: linux-2.4.21-suse2/fs/stat.c
                        UPDATE_ATIME(inode);
                        error = inode->i_op->readlink(nd.dentry, buf, bufsiz);
                }
-@@ -339,12 +351,14 @@
+@@ -339,12 +349,14 @@
  {
        struct nameidata nd;
        int error;
@@ -1522,7 +1546,7 @@ Index: linux-2.4.21-suse2/fs/stat.c
                path_release(&nd);
        }
        return error;
-@@ -354,12 +368,14 @@
+@@ -354,12 +366,14 @@
  {
        struct nameidata nd;
        int error;
@@ -1539,7 +1563,7 @@ Index: linux-2.4.21-suse2/fs/stat.c
                path_release(&nd);
        }
        return error;
-@@ -374,7 +390,7 @@
+@@ -374,7 +388,7 @@
        if (f) {
                struct dentry * dentry = f->f_dentry;
  
@@ -1548,11 +1572,11 @@ Index: linux-2.4.21-suse2/fs/stat.c
                if (!err)
                        err = cp_new_stat64(dentry->d_inode, statbuf);
                fput(f);
-Index: linux-2.4.21-suse2/include/linux/dcache.h
+Index: kernel-2.4.212lgns/include/linux/dcache.h
 ===================================================================
---- linux-2.4.21-suse2.orig/include/linux/dcache.h     2003-11-11 03:44:28.000000000 +0300
-+++ linux-2.4.21-suse2/include/linux/dcache.h  2004-01-10 12:48:36.000000000 +0300
-@@ -7,6 +7,51 @@
+--- kernel-2.4.212lgns.orig/include/linux/dcache.h     2003-11-10 16:44:28.000000000 -0800
++++ kernel-2.4.212lgns/include/linux/dcache.h  2004-05-11 06:41:10.000000000 -0700
+@@ -7,6 +7,52 @@
  #include <linux/gdb.h>
  #include <linux/mount.h>
  #include <linux/kernel.h>
@@ -1567,6 +1591,7 @@ Index: linux-2.4.21-suse2/include/linux/dcache.h
 +#define IT_GETXATTR 0x0040
 +#define IT_EXEC     0x0080
 +#define IT_PIN      0x0100
++#define IT_CHDIR    0x0200
 +
 +#define IT_FL_LOCKED   0x0001
 +#define IT_FL_FOLLOWED 0x0002 /* set by vfs_follow_link */
@@ -1604,18 +1629,27 @@ Index: linux-2.4.21-suse2/include/linux/dcache.h
  
  /*
   * linux/include/linux/dcache.h
-@@ -94,8 +139,22 @@
+@@ -87,6 +133,8 @@
+       unsigned char d_iname[DNAME_INLINE_LEN]; /* small names */
+ };
++struct nameidata;
++
+ struct dentry_operations {
+       int (*d_revalidate)(struct dentry *, int);
+       int (*d_hash) (struct dentry *, struct qstr *);
+@@ -94,8 +142,22 @@
        int (*d_delete)(struct dentry *);
        void (*d_release)(struct dentry *);
        void (*d_iput)(struct dentry *, struct inode *);
-+      int (*d_revalidate_it)(struct dentry *, int, struct lookup_intent *);
++      int (*d_revalidate_it)(struct dentry *, int, struct nameidata *, struct lookup_intent *);
 +      void (*d_pin)(struct dentry *, struct vfsmount * , int);
 +      void (*d_unpin)(struct dentry *, struct vfsmount *, int);
  };
  
-+#define PIN(de,mnt,flag)  if (de->d_op && de->d_op->d_pin) \
++#define PIN(de,mnt,flag)  if (de && de->d_op && de->d_op->d_pin) \
 +                              de->d_op->d_pin(de, mnt, flag);
-+#define UNPIN(de,mnt,flag)  if (de->d_op && de->d_op->d_unpin) \
++#define UNPIN(de,mnt,flag)  if (de && de->d_op && de->d_op->d_unpin) \
 +                              de->d_op->d_unpin(de, mnt, flag);
 +
 +
@@ -1627,7 +1661,7 @@ Index: linux-2.4.21-suse2/include/linux/dcache.h
  /* the dentry parameter passed to d_hash and d_compare is the parent
   * directory of the entries to be compared. It is used in case these
   * functions need any directory specific information for determining
-@@ -127,6 +186,7 @@
+@@ -127,6 +189,7 @@
                                         * s_nfsd_free_path semaphore will be down
                                         */
  #define DCACHE_REFERENCED     0x0008  /* Recently used, don't discard. */
@@ -1635,10 +1669,10 @@ Index: linux-2.4.21-suse2/include/linux/dcache.h
  
  extern spinlock_t dcache_lock;
  
-Index: linux-2.4.21-suse2/include/linux/fs.h
+Index: kernel-2.4.212lgns/include/linux/fs.h
 ===================================================================
---- linux-2.4.21-suse2.orig/include/linux/fs.h 2004-01-10 11:28:05.000000000 +0300
-+++ linux-2.4.21-suse2/include/linux/fs.h      2004-01-10 12:48:36.000000000 +0300
+--- kernel-2.4.212lgns.orig/include/linux/fs.h 2004-05-11 06:37:51.000000000 -0700
++++ kernel-2.4.212lgns/include/linux/fs.h      2004-05-11 06:48:41.000000000 -0700
 @@ -74,6 +74,7 @@
  
  #define FMODE_READ 1
@@ -1653,7 +1687,7 @@ Index: linux-2.4.21-suse2/include/linux/fs.h
  #define ATTR_ATTR_FLAG        1024
 +#define ATTR_RAW      0x0800  /* file system, not vfs will massage attrs */
 +#define ATTR_FROM_OPEN        0x1000  /* called from open path, ie O_TRUNC */
-+#define ATTR_CTIME_SET 0x2000
++#define ATTR_CTIME_SET        0x2000
  
  /*
   * This is the Inode Attributes structure, used for notify_change().  It
@@ -1697,7 +1731,7 @@ Index: linux-2.4.21-suse2/include/linux/fs.h
        int (*create) (struct inode *,struct dentry *,int);
 +      int (*create_it) (struct inode *,struct dentry *,int, struct lookup_intent *);
        struct dentry * (*lookup) (struct inode *,struct dentry *);
-+      struct dentry * (*lookup_it) (struct inode *,struct dentry *, struct lookup_intent *, int flags);
++      struct dentry * (*lookup_it) (struct inode *,struct dentry *, struct nameidata *, struct lookup_intent *, int flags);
        int (*link) (struct dentry *,struct inode *,struct dentry *);
 +      int (*link_raw) (struct nameidata *,struct nameidata *);
        int (*unlink) (struct inode *,struct dentry *);
@@ -1724,12 +1758,22 @@ Index: linux-2.4.21-suse2/include/linux/fs.h
        int (*getattr) (struct dentry *, struct iattr *);
        int (*setxattr) (struct dentry *, const char *, const void *, size_t, int);
        ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t);
-@@ -1205,10 +1224,14 @@
+@@ -1046,6 +1065,7 @@
+       int (*remount_fs) (struct super_block *, int *, char *);
+       void (*clear_inode) (struct inode *);
+       void (*umount_begin) (struct super_block *);
++      void (*umount_lustre) (struct super_block *);
+       /* Following are for knfsd to interact with "interesting" filesystems
+        * Currently just reiserfs, but possibly FAT and others later
+@@ -1205,10 +1225,16 @@
  
  asmlinkage long sys_open(const char *, int, int);
  asmlinkage long sys_close(unsigned int);      /* yes, it's really unsigned */
 -extern int do_truncate(struct dentry *, loff_t start);
 +extern int do_truncate(struct dentry *, loff_t start, int called_from_open);
++struct dentry *lookup_create(struct nameidata *nd, int is_dir,
++                                   struct lookup_intent *it);
  
  extern struct file *filp_open(const char *, int, int);
  extern struct file * dentry_open(struct dentry *, struct vfsmount *, int);
@@ -1740,7 +1784,7 @@ Index: linux-2.4.21-suse2/include/linux/fs.h
  extern int filp_close(struct file *, fl_owner_t id);
  extern char * getname(const char *);
  
-@@ -1504,6 +1527,7 @@
+@@ -1504,6 +1530,7 @@
  extern loff_t default_llseek(struct file *file, loff_t offset, int origin);
  
  extern int FASTCALL(__user_walk(const char *, unsigned, struct nameidata *));
@@ -1748,7 +1792,7 @@ Index: linux-2.4.21-suse2/include/linux/fs.h
  extern int FASTCALL(path_init(const char *, unsigned, struct nameidata *));
  extern int FASTCALL(path_walk(const char *, struct nameidata *));
  extern int FASTCALL(path_lookup(const char *, unsigned, struct nameidata *));
-@@ -1516,6 +1540,8 @@
+@@ -1516,6 +1543,8 @@
  extern struct dentry * lookup_hash(struct qstr *, struct dentry *);
  #define user_path_walk(name,nd)        __user_walk(name, LOOKUP_FOLLOW|LOOKUP_POSITIVE, nd)
  #define user_path_walk_link(name,nd) __user_walk(name, LOOKUP_POSITIVE, nd)
@@ -1757,7 +1801,7 @@ Index: linux-2.4.21-suse2/include/linux/fs.h
  
  extern void inode_init_once(struct inode *);
  extern void _inode_init_once(struct inode *);
-@@ -1667,6 +1693,8 @@
+@@ -1667,6 +1696,8 @@
  
  extern int vfs_readlink(struct dentry *, char *, int, const char *);
  extern int vfs_follow_link(struct nameidata *, const char *);
@@ -1766,10 +1810,10 @@ Index: linux-2.4.21-suse2/include/linux/fs.h
  extern int page_readlink(struct dentry *, char *, int);
  extern int page_follow_link(struct dentry *, struct nameidata *);
  extern struct inode_operations page_symlink_inode_operations;
-Index: linux-2.4.21-suse2/include/linux/fs_struct.h
+Index: kernel-2.4.212lgns/include/linux/fs_struct.h
 ===================================================================
---- linux-2.4.21-suse2.orig/include/linux/fs_struct.h  2001-07-14 02:10:44.000000000 +0400
-+++ linux-2.4.21-suse2/include/linux/fs_struct.h       2004-01-10 12:15:41.000000000 +0300
+--- kernel-2.4.212lgns.orig/include/linux/fs_struct.h  2001-07-13 15:10:44.000000000 -0700
++++ kernel-2.4.212lgns/include/linux/fs_struct.h       2004-05-11 06:41:10.000000000 -0700
 @@ -34,10 +34,12 @@
        write_lock(&fs->lock);
        old_root = fs->root;
@@ -1796,10 +1840,31 @@ Index: linux-2.4.21-suse2/include/linux/fs_struct.h
                dput(old_pwd);
                mntput(old_pwdmnt);
        }
-Index: linux-2.4.21-suse2/kernel/exit.c
+Index: kernel-2.4.212lgns/include/linux/mount.h
+===================================================================
+--- kernel-2.4.212lgns.orig/include/linux/mount.h      2003-11-06 14:18:54.000000000 -0800
++++ kernel-2.4.212lgns/include/linux/mount.h   2004-05-11 06:41:10.000000000 -0700
+@@ -29,6 +29,8 @@
+       int mnt_flags;
+       char *mnt_devname;              /* Name of device e.g. /dev/dsk/hda1 */
+       struct list_head mnt_list;
++      struct list_head mnt_lustre_list; /* GNS mount list */
++      unsigned long mnt_last_used;      /* for GNS auto-umount (jiffies) */
+ };
+ static inline struct vfsmount *mntget(struct vfsmount *mnt)
+@@ -39,6 +41,7 @@
+ }
+ extern void __mntput(struct vfsmount *mnt);
++extern int do_umount(struct vfsmount *mnt, int flags);
+ static inline void mntput(struct vfsmount *mnt)
+ {
+Index: kernel-2.4.212lgns/kernel/exit.c
 ===================================================================
---- linux-2.4.21-suse2.orig/kernel/exit.c      2003-10-28 21:34:13.000000000 +0300
-+++ linux-2.4.21-suse2/kernel/exit.c   2004-01-10 12:15:41.000000000 +0300
+--- kernel-2.4.212lgns.orig/kernel/exit.c      2003-10-28 10:34:13.000000000 -0800
++++ kernel-2.4.212lgns/kernel/exit.c   2004-05-11 06:41:10.000000000 -0700
 @@ -288,11 +288,14 @@
  {
        /* No need to hold fs->lock if we are killing it */
@@ -1815,10 +1880,10 @@ Index: linux-2.4.21-suse2/kernel/exit.c
                        dput(fs->altroot);
                        mntput(fs->altrootmnt);
                }
-Index: linux-2.4.21-suse2/kernel/fork.c
+Index: kernel-2.4.212lgns/kernel/fork.c
 ===================================================================
---- linux-2.4.21-suse2.orig/kernel/fork.c      2003-10-28 21:34:17.000000000 +0300
-+++ linux-2.4.21-suse2/kernel/fork.c   2004-01-10 12:15:41.000000000 +0300
+--- kernel-2.4.212lgns.orig/kernel/fork.c      2003-10-28 10:34:17.000000000 -0800
++++ kernel-2.4.212lgns/kernel/fork.c   2004-05-11 06:41:10.000000000 -0700
 @@ -461,10 +461,13 @@
                fs->umask = old->umask;
                read_lock(&old->lock);
@@ -1833,15 +1898,17 @@ Index: linux-2.4.21-suse2/kernel/fork.c
                        fs->altrootmnt = mntget(old->altrootmnt);
                        fs->altroot = dget(old->altroot);
                } else {
-Index: linux-2.4.21-suse2/kernel/ksyms.c
+Index: kernel-2.4.212lgns/kernel/ksyms.c
 ===================================================================
---- linux-2.4.21-suse2.orig/kernel/ksyms.c     2004-01-10 11:28:05.000000000 +0300
-+++ linux-2.4.21-suse2/kernel/ksyms.c  2004-01-10 12:15:41.000000000 +0300
-@@ -327,6 +327,7 @@
+--- kernel-2.4.212lgns.orig/kernel/ksyms.c     2004-05-11 06:37:51.000000000 -0700
++++ kernel-2.4.212lgns/kernel/ksyms.c  2004-05-11 06:41:10.000000000 -0700
+@@ -327,6 +327,9 @@
  EXPORT_SYMBOL(set_page_dirty);
  EXPORT_SYMBOL(vfs_readlink);
  EXPORT_SYMBOL(vfs_follow_link);
 +EXPORT_SYMBOL(vfs_follow_link_it);
++EXPORT_SYMBOL(do_umount);
++EXPORT_SYMBOL(lookup_create);
  EXPORT_SYMBOL(page_readlink);
  EXPORT_SYMBOL(page_follow_link);
  EXPORT_SYMBOL(page_symlink_inode_operations);