Whamcloud - gitweb
new series for suse 2.6.3 kernel
authorhitao <hitao>
Tue, 9 Mar 2004 15:41:57 +0000 (15:41 +0000)
committerhitao <hitao>
Tue, 9 Mar 2004 15:41:57 +0000 (15:41 +0000)
lustre/kernel_patches/patches/nfs-cifs-intent-2.6.3-suse.patch [new file with mode: 0644]
lustre/kernel_patches/patches/vfs_intent-2.6.3-suse.patch [new file with mode: 0644]
lustre/kernel_patches/patches/vfs_nointent_2.6.3-suse.patch [new file with mode: 0644]
lustre/kernel_patches/series/suse-2.6.3 [new file with mode: 0644]

diff --git a/lustre/kernel_patches/patches/nfs-cifs-intent-2.6.3-suse.patch b/lustre/kernel_patches/patches/nfs-cifs-intent-2.6.3-suse.patch
new file mode 100644 (file)
index 0000000..1a3d7f4
--- /dev/null
@@ -0,0 +1,111 @@
+.old..........pc/linux-2.6.3-nfs-intent-suse/fs/nfs/dir.c
+.new.........fs/nfs/dir.c
+.old..........pc/linux-2.6.3-nfs-intent-suse/fs/nfs/dir.c
+.new.........fs/nfs/dir.c
+Index: linux-2.6.3-20/fs/nfs/dir.c
+===================================================================
+--- linux-2.6.3-20.orig/fs/nfs/dir.c   2004-03-08 14:23:40.000000000 -0800
++++ linux-2.6.3-20/fs/nfs/dir.c        2004-03-08 17:07:34.000000000 -0800
+@@ -751,7 +751,7 @@
+       if (nd->flags & LOOKUP_DIRECTORY)
+               return 0;
+       /* Are we trying to write to a read only partition? */
+-      if (IS_RDONLY(dir) && (nd->intent.open.flags & (O_CREAT|O_TRUNC|FMODE_WRITE)))
++      if (IS_RDONLY(dir) && (nd->intent.it_flags & (O_CREAT|O_TRUNC|FMODE_WRITE)))
+               return 0;
+       return 1;
+ }
+@@ -772,7 +772,7 @@
+       dentry->d_op = NFS_PROTO(dir)->dentry_ops;
+       /* Let vfs_create() deal with O_EXCL */
+-      if (nd->intent.open.flags & O_EXCL)
++      if (nd->intent.it_flags & O_EXCL)
+               goto no_entry;
+       /* Open the file on the server */
+@@ -788,7 +788,7 @@
+                               break;
+                       /* This turned out not to be a regular file */
+                       case -ELOOP:
+-                              if (!(nd->intent.open.flags & O_NOFOLLOW))
++                              if (!(nd->intent.it_flags & O_NOFOLLOW))
+                                       goto no_open;
+                       /* case -EISDIR: */
+                       /* case -EINVAL: */
+@@ -818,7 +818,7 @@
+       parent = dget_parent(dentry);
+       if (!is_atomic_open(parent->d_inode, nd))
+               goto no_open;
+-      openflags = nd->intent.open.flags;
++      openflags = nd->intent.it_flags;
+       if (openflags & O_CREAT) {
+               /* If this is a negative dentry, just drop it */
+               if (!inode)
+.old..........pc/linux-2.6.3-nfs-intent-suse/fs/nfs/nfs4proc.c
+.new.........fs/nfs/nfs4proc.c
+Index: linux-2.6.3-20/fs/nfs/nfs4proc.c
+===================================================================
+--- linux-2.6.3-20.orig/fs/nfs/nfs4proc.c      2004-03-05 02:07:03.000000000 -0800
++++ linux-2.6.3-20/fs/nfs/nfs4proc.c   2004-03-08 17:07:34.000000000 -0800
+@@ -778,17 +778,17 @@
+       struct nfs4_state *state;
+       if (nd->flags & LOOKUP_CREATE) {
+-              attr.ia_mode = nd->intent.open.create_mode;
++              attr.ia_mode = nd->intent.it_create_mode;
+               attr.ia_valid = ATTR_MODE;
+               if (!IS_POSIXACL(dir))
+                       attr.ia_mode &= ~current->fs->umask;
+       } else {
+               attr.ia_valid = 0;
+-              BUG_ON(nd->intent.open.flags & O_CREAT);
++              BUG_ON(nd->intent.it_flags & O_CREAT);
+       }
+       cred = rpcauth_lookupcred(NFS_SERVER(dir)->client->cl_auth, 0);
+-      state = nfs4_do_open(dir, &dentry->d_name, nd->intent.open.flags, &attr, cred);
++      state = nfs4_do_open(dir, &dentry->d_name, nd->intent.it_flags, &attr, cred);
+       put_rpccred(cred);
+       if (IS_ERR(state))
+               return (struct inode *)state;
+.old..........pc/linux-2.6.3-nfs-intent-suse/fs/cifs/dir.c
+.new.........fs/cifs/dir.c
+Index: linux-2.6.3-20/fs/cifs/dir.c
+===================================================================
+--- linux-2.6.3-20.orig/fs/cifs/dir.c  2004-03-05 02:07:03.000000000 -0800
++++ linux-2.6.3-20/fs/cifs/dir.c       2004-03-08 17:16:19.000000000 -0800
+@@ -146,18 +146,18 @@
+       if(nd) { 
+               cFYI(1,("In create for inode %p dentry->inode %p nd flags = 0x%x for %s",inode, direntry->d_inode, nd->flags,full_path));
+-              if ((nd->intent.open.flags & O_ACCMODE) == O_RDONLY)
++              if ((nd->intent.it_flags & O_ACCMODE) == O_RDONLY)
+                       desiredAccess = GENERIC_READ;
+-              else if ((nd->intent.open.flags & O_ACCMODE) == O_WRONLY)
++              else if ((nd->intent.it_flags & O_ACCMODE) == O_WRONLY)
+                       desiredAccess = GENERIC_WRITE;
+-              else if ((nd->intent.open.flags & O_ACCMODE) == O_RDWR)
++              else if ((nd->intent.it_flags & O_ACCMODE) == O_RDWR)
+                       desiredAccess = GENERIC_ALL;
+-              if((nd->intent.open.flags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL))
++              if((nd->intent.it_flags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL))
+                       disposition = FILE_CREATE;
+-              else if((nd->intent.open.flags & (O_CREAT | O_TRUNC)) == (O_CREAT | O_TRUNC))
++              else if((nd->intent.it_flags & (O_CREAT | O_TRUNC)) == (O_CREAT | O_TRUNC))
+                       disposition = FILE_OVERWRITE_IF;
+-              else if((nd->intent.open.flags & O_CREAT) == O_CREAT)
++              else if((nd->intent.it_flags & O_CREAT) == O_CREAT)
+                       disposition = FILE_OPEN_IF;
+               else {
+                       cFYI(1,("Create flag not set in create function"));
+@@ -314,7 +314,7 @@
+             parent_dir_inode, direntry->d_name.name, direntry));
+       if(nd) {  /* BB removeme */
+-              cFYI(1,("In lookup nd flags 0x%x open intent flags 0x%x",nd->flags,nd->intent.open.flags));
++              cFYI(1,("In lookup nd flags 0x%x open intent flags 0x%x",nd->flags,nd->intent.it_flags));
+       } /* BB removeme BB */
+       /* BB Add check of incoming data - e.g. frame not longer than maximum SMB - let server check the namelen BB */
diff --git a/lustre/kernel_patches/patches/vfs_intent-2.6.3-suse.patch b/lustre/kernel_patches/patches/vfs_intent-2.6.3-suse.patch
new file mode 100644 (file)
index 0000000..aaae350
--- /dev/null
@@ -0,0 +1,777 @@
+ fs/exec.c              |   18 +++++++---
+ fs/namei.c             |   86 +++++++++++++++++++++++++++++++++++++++++++++----
+ fs/namespace.c         |    2 +
+ fs/nfs/dir.c           |    4 +-
+ fs/open.c              |   62 +++++++++++++++++++++++------------
+ fs/stat.c              |   24 ++++++++++---
+ include/linux/dcache.h |    3 +
+ include/linux/fs.h     |    8 ++++
+ include/linux/namei.h  |   56 ++++++++++++++++++++++++++-----
+ kernel/ksyms.c         |    8 ++++
+ 10 files changed, 222 insertions(+), 49 deletions(-)
+
+.old..........pc/vfs_intent-2.6.3-suse/fs/exec.c
+.new.........fs/exec.c
+Index: linux-2.6.3-20/fs/exec.c
+===================================================================
+--- linux-2.6.3-20.orig/fs/exec.c      2004-03-05 02:07:04.000000000 -0800
++++ linux-2.6.3-20/fs/exec.c   2004-03-08 14:23:40.000000000 -0800
+@@ -121,8 +121,11 @@
+       struct file * file;
+       struct nameidata nd;
+       int error;
++      intent_init(&nd.intent, IT_OPEN);
+-      nd.intent.open.flags = FMODE_READ;
++      error = user_path_walk_it(library, &nd);
++
++      nd.intent.it_flags = O_RDONLY;
+       error = __user_walk(library, LOOKUP_FOLLOW|LOOKUP_OPEN, &nd);
+       if (error)
+               goto out;
+@@ -135,7 +138,7 @@
+       if (error)
+               goto exit;
+-      file = dentry_open(nd.dentry, nd.mnt, O_RDONLY);
++      file = dentry_open_it(nd.dentry, nd.mnt, O_RDONLY, &nd.intent);
+       error = PTR_ERR(file);
+       if (IS_ERR(file))
+               goto out;
+@@ -475,8 +478,9 @@
+       int err;
+       struct file *file;
+-      nd.intent.open.flags = FMODE_READ;
+-      err = path_lookup(name, LOOKUP_FOLLOW|LOOKUP_OPEN, &nd);
++      intent_init(&nd.intent, IT_OPEN);
++      nd.intent.it_flags = O_RDONLY;
++      err = path_lookup(name, LOOKUP_FOLLOW, &nd);
+       file = ERR_PTR(err);
+       if (!err) {
+@@ -489,7 +493,7 @@
+                               err = -EACCES;
+                       file = ERR_PTR(err);
+                       if (!err) {
+-                              file = dentry_open(nd.dentry, nd.mnt, O_RDONLY);
++                              file = dentry_open_it(nd.dentry, nd.mnt, O_RDONLY, &nd.intent);
+                               if (!IS_ERR(file)) {
+                                       err = deny_write_access(file);
+                                       if (err) {
+.old..........pc/vfs_intent-2.6.3-suse/fs/namei.c
+.new.........fs/namei.c
+Index: linux-2.6.3-20/fs/namei.c
+===================================================================
+--- linux-2.6.3-20.orig/fs/namei.c     2004-03-05 02:07:04.000000000 -0800
++++ linux-2.6.3-20/fs/namei.c  2004-03-08 14:32:24.000000000 -0800
+@@ -269,8 +269,19 @@
+       return 0;
+ }
++void intent_release(struct lookup_intent *it)
++{
++      if (!it)
++              return;
++      if (it->it_magic != INTENT_MAGIC)
++              return;
++      if (it->it_op_release)
++              it->it_op_release(it);
++}
++
+ void path_release(struct nameidata *nd)
+ {
++      intent_release(&nd->intent);
+       dput(nd->dentry);
+       mntput(nd->mnt);
+ }
+@@ -347,7 +358,10 @@
+ {
+       struct dentry * result;
+       struct inode *dir = parent->d_inode;
++      int counter = 0;
++again:
++      counter++;
+       down(&dir->i_sem);
+       /*
+        * First re-do the cached lookup just in case it was created
+@@ -386,7 +400,10 @@
+       if (result->d_op && result->d_op->d_revalidate) {
+               if (!result->d_op->d_revalidate(result, nd) && !d_invalidate(result)) {
+                       dput(result);
+-                      result = ERR_PTR(-ENOENT);
++                      if (counter > 10)
++                              result = ERR_PTR(-ESTALE);
++                      if (!IS_ERR(result))
++                              goto again;
+               }
+       }
+       return result;
+@@ -563,6 +580,31 @@
+       return PTR_ERR(dentry);
+ }
++static int revalidate_special(struct nameidata *nd)
++{
++      struct dentry *dentry = nd->dentry;
++      int err, counter = 0;
++
++      if (!dentry->d_op || !dentry->d_op->d_revalidate)
++              return 0;
++ revalidate_again:
++      if (!dentry->d_op->d_revalidate(dentry, nd)) {
++              struct dentry *new;
++              if ((err = permission(dentry->d_parent->d_inode, MAY_EXEC,nd)))
++                      return err;
++              new = real_lookup(dentry->d_parent, &dentry->d_name, nd);
++              d_invalidate(dentry);
++              dput(dentry);
++              nd->dentry = dentry = new;
++              counter++;
++              if (counter < 10)
++                      goto revalidate_again;
++              printk("excessive revalidate_it loops\n");
++              return -ESTALE;
++      }
++      return 0;
++}
++
+ /*
+  * Name resolution.
+  *
+@@ -663,7 +705,9 @@
+               if (inode->i_op->follow_link) {
+                       mntget(next.mnt);
++                      nd->flags |= LOOKUP_LINK_NOTLAST;
+                       err = do_follow_link(next.dentry, nd);
++                      nd->flags &= ~LOOKUP_LINK_NOTLAST;
+                       dput(next.dentry);
+                       mntput(next.mnt);
+                       if (err)
+@@ -702,6 +746,11 @@
+                               inode = nd->dentry->d_inode;
+                               /* fallthrough */
+                       case 1:
++                              nd->flags |= LOOKUP_LAST;
++                              err = revalidate_special(nd);
++                              nd->flags &= ~LOOKUP_LAST;
++                              if (err)
++                                      break;
+                               goto return_reval;
+               }
+               if (nd->dentry->d_op && nd->dentry->d_op->d_hash) {
+@@ -709,7 +758,9 @@
+                       if (err < 0)
+                               break;
+               }
++              nd->flags |= LOOKUP_LAST;
+               err = do_lookup(nd, &this, &next);
++              nd->flags &= ~LOOKUP_LAST;
+               if (err)
+                       break;
+               follow_mount(&next.mnt, &next.dentry);
+@@ -935,7 +986,7 @@
+ }
+ /* SMP-safe */
+-struct dentry * lookup_one_len(const char * name, struct dentry * base, int len)
++struct dentry * lookup_one_len_it(const char * name, struct dentry * base, int len, struct nameidata *nd)
+ {
+       unsigned long hash;
+       struct qstr this;
+@@ -955,11 +1006,16 @@
+       }
+       this.hash = end_name_hash(hash);
+-      return lookup_hash(&this, base);
++      return __lookup_hash(&this, base, nd);
+ access:
+       return ERR_PTR(-EACCES);
+ }
++struct dentry * lookup_one_len(const char * name, struct dentry * base, int len)
++{
++      return lookup_one_len_it(name, base, len, NULL);
++}
++
+ /*
+  *    namei()
+  *
+@@ -971,7 +1027,7 @@
+  * that namei follows links, while lnamei does not.
+  * SMP-safe
+  */
+-int fastcall __user_walk(const char __user *name, unsigned flags, struct nameidata *nd)
++int fastcall __user_walk_it(const char __user *name, unsigned flags, struct nameidata *nd)
+ {
+       char *tmp = getname(name);
+       int err = PTR_ERR(tmp);
+@@ -983,6 +1039,12 @@
+       return err;
+ }
++int __user_walk(const char __user *name, unsigned flags, struct nameidata *nd)
++{
++      intent_init(&nd->intent, IT_LOOKUP);
++      return __user_walk_it(name, flags, nd);
++}
++
+ /*
+  * It's inline, so penalty for filesystems that don't use sticky bit is
+  * minimal.
+@@ -1255,8 +1317,8 @@
+               acc_mode |= MAY_APPEND;
+       /* Fill in the open() intent data */
+-      nd->intent.open.flags = flag;
+-      nd->intent.open.create_mode = mode;
++      nd->intent.it_flags = flag;
++      nd->intent.it_create_mode = mode;
+       /*
+        * The simplest case - just a plain lookup.
+@@ -1271,6 +1333,7 @@
+       /*
+        * Create - we need to know the parent.
+        */
++      nd->intent.it_op |= IT_CREAT;
+       error = path_lookup(pathname, LOOKUP_PARENT|LOOKUP_OPEN|LOOKUP_CREATE, nd);
+       if (error)
+               return error;
+@@ -1287,7 +1350,9 @@
+       dir = nd->dentry;
+       nd->flags &= ~LOOKUP_PARENT;
+       down(&dir->d_inode->i_sem);
++      nd->flags |= LOOKUP_LAST;
+       dentry = __lookup_hash(&nd->last, nd->dentry, nd);
++      nd->flags &= ~LOOKUP_LAST;
+ do_last:
+       error = PTR_ERR(dentry);
+@@ -1392,7 +1457,9 @@
+       }
+       dir = nd->dentry;
+       down(&dir->d_inode->i_sem);
++      nd->flags |= LOOKUP_LAST;
+       dentry = __lookup_hash(&nd->last, nd->dentry, nd);
++      nd->flags &= ~LOOKUP_LAST;
+       putname(nd->last.name);
+       goto do_last;
+ }
+@@ -2154,7 +2221,9 @@
+ __vfs_follow_link(struct nameidata *nd, const char *link)
+ {
+       int res = 0;
++      struct lookup_intent it = nd->intent;
+       char *name;
++
+       if (IS_ERR(link))
+               goto fail;
+@@ -2164,6 +2233,10 @@
+                       /* weird __emul_prefix() stuff did it */
+                       goto out;
+       }
++
++      intent_init(&nd->intent, it.it_op);
++      nd->intent.it_flags = it.it_flags;
++      nd->intent.it_create_mode = it.it_create_mode;
+       res = link_path_walk(link, nd);
+ out:
+       if (current->link_count || res || nd->last_type!=LAST_NORM)
+.old..........pc/vfs_intent-2.6.3-suse/fs/namespace.c
+.new.........fs/namespace.c
+Index: linux-2.6.3-20/fs/namespace.c
+===================================================================
+--- linux-2.6.3-20.orig/fs/namespace.c 2004-03-05 02:07:04.000000000 -0800
++++ linux-2.6.3-20/fs/namespace.c      2004-03-08 14:23:40.000000000 -0800
+@@ -744,6 +744,7 @@
+       int retval = 0;
+       int mnt_flags = 0;
++      intent_init(&nd.intent, IT_LOOKUP);
+       /* Discard magic */
+       if ((flags & MS_MGC_MSK) == MS_MGC_VAL)
+               flags &= ~MS_MGC_MSK;
+.old..........pc/vfs_intent-2.6.3-suse/fs/open.c
+.new.........fs/open.c
+Index: linux-2.6.3-20/fs/open.c
+===================================================================
+--- linux-2.6.3-20.orig/fs/open.c      2004-03-05 02:07:04.000000000 -0800
++++ linux-2.6.3-20/fs/open.c   2004-03-08 14:23:40.000000000 -0800
+@@ -202,7 +202,7 @@
+       struct nameidata nd;
+       struct inode * inode;
+       int error;
+-
++      intent_init(&nd.intent, IT_GETATTR);
+       error = -EINVAL;
+       if (length < 0) /* sorry, but loff_t says... */
+               goto out;
+@@ -461,6 +461,7 @@
+       int old_fsuid, old_fsgid;
+       kernel_cap_t old_cap;
+       int res;
++      intent_init(&nd.intent, IT_GETATTR);
+       if (mode & ~S_IRWXO)    /* where's F_OK, X_OK, W_OK, R_OK? */
+               return -EINVAL;
+@@ -492,6 +493,7 @@
+               if(!res && (mode & S_IWOTH) && IS_RDONLY(nd.dentry->d_inode)
+                  && !special_file(nd.dentry->d_inode->i_mode))
+                       res = -EROFS;
++
+               path_release(&nd);
+       }
+@@ -506,6 +508,7 @@
+ {
+       struct nameidata nd;
+       int error;
++      intent_init(&nd.intent, IT_GETATTR);
+       error = __user_walk(filename, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &nd);
+       if (error)
+@@ -557,6 +560,7 @@
+ {
+       struct nameidata nd;
+       int error;
++      intent_init(&nd.intent, IT_GETATTR);
+       error = __user_walk(filename, LOOKUP_FOLLOW | LOOKUP_DIRECTORY | LOOKUP_NOALT, &nd);
+       if (error)
+@@ -629,7 +633,7 @@
+       error = -EROFS;
+       if (IS_RDONLY(inode))
+               goto dput_and_out;
+-
++      
+       error = -EPERM;
+       if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
+               goto dput_and_out;
+@@ -737,27 +741,8 @@
+  * for the internal routines (ie open_namei()/follow_link() etc). 00 is
+  * used by symlinks.
+  */
+-struct file *filp_open(const char * filename, int flags, int mode)
+-{
+-      int namei_flags, error;
+-      struct nameidata nd;
+-
+-      namei_flags = flags;
+-      if ((namei_flags+1) & O_ACCMODE)
+-              namei_flags++;
+-      if (namei_flags & O_TRUNC)
+-              namei_flags |= 2;
+-
+-      error = open_namei(filename, namei_flags, mode, &nd);
+-      if (!error)
+-              return dentry_open(nd.dentry, nd.mnt, flags);
+-
+-      return ERR_PTR(error);
+-}
+-
+-EXPORT_SYMBOL(filp_open);
+-
+-struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags)
++struct file *dentry_open_it(struct dentry *dentry, struct vfsmount *mnt, int flags,
++                          struct lookup_intent *it)
+ {
+       struct file * f;
+       struct inode *inode;
+@@ -769,6 +754,7 @@
+               goto cleanup_dentry;
+       f->f_flags = flags;
+       f->f_mode = (flags+1) & O_ACCMODE;
++      f->f_it = it;
+       inode = dentry->d_inode;
+       if (f->f_mode & FMODE_WRITE) {
+               error = get_write_access(inode);
+@@ -788,6 +774,7 @@
+               error = f->f_op->open(inode,f);
+               if (error)
+                       goto cleanup_all;
++              intent_release(it);
+       }
+       f->f_flags &= ~(O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC);
+@@ -812,6 +799,7 @@
+ cleanup_file:
+       put_filp(f);
+ cleanup_dentry:
++      intent_release(it);
+       dput(dentry);
+       mntput(mnt);
+       return ERR_PTR(error);
+@@ -819,6 +807,36 @@
+ EXPORT_SYMBOL(dentry_open);
++struct file *filp_open(const char * filename, int flags, int mode)
++{
++      int namei_flags, error;
++      struct file * temp_filp;
++      struct nameidata nd;
++      intent_init(&nd.intent, IT_OPEN);
++
++      namei_flags = flags;
++      if ((namei_flags+1) & O_ACCMODE)
++              namei_flags++;
++      if (namei_flags & O_TRUNC)
++              namei_flags |= 2;
++
++      error = open_namei(filename, namei_flags, mode, &nd);
++      if (!error) {
++              temp_filp = dentry_open_it(nd.dentry, nd.mnt, flags, &nd.intent);
++              return temp_filp;
++      }       
++      return ERR_PTR(error);
++}
++
++
++struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags)
++{
++      struct lookup_intent it;
++      intent_init(&it, IT_LOOKUP);
++
++      return dentry_open_it(dentry, mnt, flags, &it);
++}
++
+ /*
+  * Find an empty file descriptor entry, and mark it busy.
+  */
+.old..........pc/vfs_intent-2.6.3-suse/fs/stat.c
+.new.........fs/stat.c
+Index: linux-2.6.3-20/fs/stat.c
+===================================================================
+--- linux-2.6.3-20.orig/fs/stat.c      2004-03-05 02:07:04.000000000 -0800
++++ linux-2.6.3-20/fs/stat.c   2004-03-08 14:23:40.000000000 -0800
+@@ -36,7 +36,7 @@
+ EXPORT_SYMBOL(generic_fillattr);
+-int vfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
++int vfs_getattr_it(struct vfsmount *mnt, struct dentry *dentry, struct lookup_intent *it, struct kstat *stat)
+ {
+       struct inode *inode = dentry->d_inode;
+       int retval;
+@@ -45,6 +45,8 @@
+       if (retval)
+               return retval;
++      if (inode->i_op->getattr_it)
++              return inode->i_op->getattr_it(mnt, dentry, it, stat);
+       if (inode->i_op->getattr)
+               return inode->i_op->getattr(mnt, dentry, stat);
+@@ -61,14 +63,20 @@
+ EXPORT_SYMBOL(vfs_getattr);
++int vfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
++{
++      return vfs_getattr_it(mnt, dentry, NULL, stat);
++}
++
+ int vfs_stat(char __user *name, struct kstat *stat)
+ {
+       struct nameidata nd;
+       int error;
++      intent_init(&nd.intent, IT_GETATTR);
+-      error = user_path_walk(name, &nd);
++      error = user_path_walk_it(name, &nd);
+       if (!error) {
+-              error = vfs_getattr(nd.mnt, nd.dentry, stat);
++              error = vfs_getattr_it(nd.mnt, nd.dentry, &nd.intent, stat);
+               path_release(&nd);
+       }
+       return error;
+@@ -80,10 +88,11 @@
+ {
+       struct nameidata nd;
+       int error;
++      intent_init(&nd.intent, IT_GETATTR);
+-      error = user_path_walk_link(name, &nd);
++      error = user_path_walk_link_it(name, &nd);
+       if (!error) {
+-              error = vfs_getattr(nd.mnt, nd.dentry, stat);
++              error = vfs_getattr_it(nd.mnt, nd.dentry, &nd.intent, stat);
+               path_release(&nd);
+       }
+       return error;
+@@ -95,9 +104,12 @@
+ {
+       struct file *f = fget(fd);
+       int error = -EBADF;
++      struct nameidata nd;
++      intent_init(&nd.intent, IT_GETATTR);
+       if (f) {
+-              error = vfs_getattr(f->f_vfsmnt, f->f_dentry, stat);
++              error = vfs_getattr_it(f->f_vfsmnt, f->f_dentry, &nd.intent, stat);
++              intent_release(&nd.intent);
+               fput(f);
+       }
+       return error;
+.old..........pc/vfs_intent-2.6.3-suse/fs/nfs/dir.c
+.new.........fs/nfs/dir.c
+Index: linux-2.6.3-20/fs/nfs/dir.c
+===================================================================
+--- linux-2.6.3-20.orig/fs/nfs/dir.c   2004-03-05 02:07:03.000000000 -0800
++++ linux-2.6.3-20/fs/nfs/dir.c        2004-03-08 14:23:40.000000000 -0800
+@@ -681,7 +681,7 @@
+               return 0;
+       if (!nd || (nd->flags & LOOKUP_CONTINUE) || !(nd->flags & LOOKUP_CREATE))
+               return 0;
+-      return (nd->intent.open.flags & O_EXCL) != 0;
++      return (nd->intent.it_flags & O_EXCL) != 0;
+ }
+ static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, struct nameidata *nd)
+@@ -972,7 +972,7 @@
+       attr.ia_valid = ATTR_MODE;
+       if (nd && (nd->flags & LOOKUP_CREATE))
+-              open_flags = nd->intent.open.flags;
++              open_flags = nd->intent.it_flags;
+       /*
+        * The 0 argument passed into the create function should one day
+.old..........pc/vfs_intent-2.6.3-suse/fs/inode.c
+.new.........fs/inode.c
+Index: linux-2.6.3-20/fs/inode.c
+===================================================================
+--- linux-2.6.3-20.orig/fs/inode.c     2004-03-05 02:07:04.000000000 -0800
++++ linux-2.6.3-20/fs/inode.c  2004-03-08 14:23:40.000000000 -0800
+@@ -223,6 +223,7 @@
+       inodes_stat.nr_unused--;
+ }
++EXPORT_SYMBOL(__iget);
+ /**
+  * clear_inode - clear an inode
+  * @inode: inode to clear
+.old..........pc/vfs_intent-2.6.3-suse/fs/super.c
+.new.........fs/super.c
+Index: linux-2.6.3-20/fs/super.c
+===================================================================
+--- linux-2.6.3-20.orig/fs/super.c     2004-03-05 02:07:04.000000000 -0800
++++ linux-2.6.3-20/fs/super.c  2004-03-08 14:23:40.000000000 -0800
+@@ -841,6 +841,8 @@
+       return (struct vfsmount *)sb;
+ }
++EXPORT_SYMBOL(do_kern_mount);
++
+ struct vfsmount *kern_mount(struct file_system_type *type)
+ {
+       return do_kern_mount(type->name, 0, type->name, NULL);
+.old..........pc/vfs_intent-2.6.3-suse/include/linux/dcache.h
+.new.........include/linux/dcache.h
+Index: linux-2.6.3-20/include/linux/dcache.h
+===================================================================
+--- linux-2.6.3-20.orig/include/linux/dcache.h 2004-03-05 02:07:17.000000000 -0800
++++ linux-2.6.3-20/include/linux/dcache.h      2004-03-08 14:23:40.000000000 -0800
+@@ -4,6 +4,7 @@
+ #ifdef __KERNEL__
+ #include <asm/atomic.h>
++#include <linux/string.h>
+ #include <linux/list.h>
+ #include <linux/spinlock.h>
+ #include <linux/cache.h>
+@@ -35,6 +36,8 @@
+       char name_str[0];
+ };
++#include <linux/namei.h>
++
+ struct dentry_stat_t {
+       int nr_dentry;
+       int nr_unused;
+.old..........pc/vfs_intent-2.6.3-suse/include/linux/fs.h
+.new.........include/linux/fs.h
+Index: linux-2.6.3-20/include/linux/fs.h
+===================================================================
+--- linux-2.6.3-20.orig/include/linux/fs.h     2004-03-05 02:07:17.000000000 -0800
++++ linux-2.6.3-20/include/linux/fs.h  2004-03-08 14:23:41.000000000 -0800
+@@ -243,6 +243,8 @@
+ #define ATTR_ATTR_FLAG        1024
+ #define ATTR_KILL_SUID        2048
+ #define ATTR_KILL_SGID        4096
++#define ATTR_RAW              8192    /* file system, not vfs will massage attrs */
++#define ATTR_FROM_OPEN        16384    /* called from open path, ie O_TRUNC */
+ /*
+  * This is the Inode Attributes structure, used for notify_change().  It
+@@ -409,6 +411,7 @@
+       struct block_device     *i_bdev;
+       struct cdev             *i_cdev;
+       int                     i_cindex;
++      void                    *i_filterdata;
+       unsigned long           i_dnotify_mask; /* Directory notify events */
+       struct dnotify_struct   *i_dnotify; /* for directory notifications */
+@@ -541,6 +544,7 @@
+       spinlock_t              f_ep_lock;
+ #endif /* #ifdef CONFIG_EPOLL */
+       struct address_space    *f_mapping;
++      struct lookup_intent    *f_it;
+ };
+ extern spinlock_t files_lock;
+ #define file_list_lock() spin_lock(&files_lock);
+@@ -846,7 +850,9 @@
+       void (*truncate) (struct inode *);
+       int (*permission) (struct inode *, int, struct nameidata *);
+       int (*setattr) (struct dentry *, struct iattr *);
++      int (*setattr_raw) (struct inode *, struct iattr *);
+       int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *);
++      int (*getattr_it) (struct vfsmount *, struct dentry *, struct lookup_intent *, struct kstat *);
+       int (*setxattr) (struct dentry *, const char *,const void *,size_t,int);
+       ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t);
+       ssize_t (*listxattr) (struct dentry *, char *, size_t);
+@@ -1062,6 +1068,7 @@
+ extern int unregister_filesystem(struct file_system_type *);
+ extern struct vfsmount *kern_mount(struct file_system_type *);
+ extern int may_umount(struct vfsmount *);
++struct vfsmount *do_kern_mount(const char *type, int flags, const char *name, void *data);
+ extern long do_mount(char *, char *, char *, unsigned long, void *);
+ extern int vfs_statfs(struct super_block *, struct kstatfs *);
+@@ -1126,6 +1133,7 @@
+ extern int do_truncate(struct dentry *, loff_t start);
+ 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 *);
+ extern int filp_close(struct file *, fl_owner_t id);
+ extern char * getname(const char __user *);
+.old..........pc/vfs_intent-2.6.3-suse/include/linux/namei.h
+.new.........include/linux/namei.h
+Index: linux-2.6.3-20/include/linux/namei.h
+===================================================================
+--- linux-2.6.3-20.orig/include/linux/namei.h  2004-03-05 02:07:18.000000000 -0800
++++ linux-2.6.3-20/include/linux/namei.h       2004-03-08 14:23:41.000000000 -0800
+@@ -2,25 +2,55 @@
+ #define _LINUX_NAMEI_H
+ #include <linux/linkage.h>
++#include <linux/string.h>
+ struct vfsmount;
++struct nameidata;
+-struct open_intent {
+-      int     flags;
+-      int     create_mode;
++/* intent opcodes */
++#define IT_OPEN     (1)
++#define IT_CREAT    (1<<1)
++#define IT_READDIR  (1<<2)
++#define IT_GETATTR  (1<<3)
++#define IT_LOOKUP   (1<<4)
++#define IT_UNLINK   (1<<5)
++#define IT_TRUNC    (1<<6)
++#define IT_GETXATTR (1<<7)
++
++struct lustre_intent_data {
++      int       it_disposition;
++      int       it_status;
++      __u64     it_lock_handle;
++      void     *it_data;
++      int       it_lock_mode;
+ };
++#define INTENT_MAGIC 0x19620323
++struct lookup_intent {
++      int     it_magic;
++      void    (*it_op_release)(struct lookup_intent *);
++      int     it_op;
++      int     it_flags;
++      int     it_create_mode;
++      union {
++              struct lustre_intent_data lustre;
++      } d;
++};
++
++static inline void intent_init(struct lookup_intent *it, int op)
++{
++      memset(it, 0, sizeof(*it));
++      it->it_magic = INTENT_MAGIC;
++      it->it_op = op;
++}
++
+ struct nameidata {
+       struct dentry   *dentry;
+       struct vfsmount *mnt;
+       struct qstr     last;
+       unsigned int    flags;
+       int             last_type;
+-
+-      /* Intent data */
+-      union {
+-              struct open_intent open;
+-      } intent;
++      struct lookup_intent intent;
+ };
+ /*
+@@ -41,6 +71,9 @@
+ #define LOOKUP_CONTINUE                4
+ #define LOOKUP_PARENT         16
+ #define LOOKUP_NOALT          32
++#define LOOKUP_LAST            (1<<6)
++#define LOOKUP_LINK_NOTLAST    (1<<7)
++
+ /*
+  * Intent data
+  */
+@@ -49,6 +82,12 @@
+ #define LOOKUP_ACCESS         (0x0400)
+ extern int FASTCALL(__user_walk(const char __user *, unsigned, struct nameidata *));
++extern int FASTCALL(__user_walk_it(const char __user *name, unsigned flags, struct nameidata *nd));
++#define user_path_walk_it(name,nd) \
++      __user_walk_it(name, LOOKUP_FOLLOW, nd)
++#define user_path_walk_link_it(name,nd) \
++      __user_walk_it(name, 0, nd)
++extern void intent_release(struct lookup_intent *);
+ #define user_path_walk(name,nd) \
+       __user_walk(name, LOOKUP_FOLLOW, nd)
+ #define user_path_walk_link(name,nd) \
+@@ -60,7 +99,6 @@
+ extern struct dentry * lookup_one_len(const char *, struct dentry *, int);
+ extern struct dentry * lookup_hash(struct qstr *, struct dentry *);
+-
+ extern int follow_down(struct vfsmount **, struct dentry **);
+ extern int follow_up(struct vfsmount **, struct dentry **);
+.old..........pc/vfs_intent-2.6.3-suse/kernel/exit.c
+.new.........kernel/exit.c
+Index: linux-2.6.3-20/kernel/exit.c
+===================================================================
+--- linux-2.6.3-20.orig/kernel/exit.c  2004-03-05 02:07:17.000000000 -0800
++++ linux-2.6.3-20/kernel/exit.c       2004-03-08 14:23:41.000000000 -0800
+@@ -258,6 +258,8 @@
+       write_unlock_irq(&tasklist_lock);
+ }
++EXPORT_SYMBOL(reparent_to_init);
++
+ void __set_special_pids(pid_t session, pid_t pgrp)
+ {
+       struct task_struct *curr = current;
+@@ -427,6 +429,8 @@
+       __exit_files(tsk);
+ }
++EXPORT_SYMBOL(exit_files);
++
+ static inline void __put_fs_struct(struct fs_struct *fs)
+ {
+       /* No need to hold fs->lock if we are killing it */
diff --git a/lustre/kernel_patches/patches/vfs_nointent_2.6.3-suse.patch b/lustre/kernel_patches/patches/vfs_nointent_2.6.3-suse.patch
new file mode 100644 (file)
index 0000000..c72c0b9
--- /dev/null
@@ -0,0 +1,433 @@
+ 0 files changed
+
+.old..........pc/vfs_nointent_2.6.0-suse/fs/namei.c
+.new.........fs/namei.c
+Index: linux-2.6.3-20/fs/namei.c
+===================================================================
+--- linux-2.6.3-20.orig/fs/namei.c     2004-03-08 14:32:24.000000000 -0800
++++ linux-2.6.3-20/fs/namei.c  2004-03-08 14:40:01.000000000 -0800
+@@ -1276,7 +1276,7 @@
+               if (!error) {
+                       DQUOT_INIT(inode);
+                       
+-                      error = do_truncate(dentry, 0);
++                      error = do_truncate(dentry, 0, 1);
+               }
+               put_write_access(inode);
+               if (error)
+@@ -1526,6 +1526,7 @@
+       char * tmp;
+       struct dentry * dentry;
+       struct nameidata nd;
++      intent_init(&nd.intent, IT_LOOKUP);
+       if (S_ISDIR(mode))
+               return -EPERM;
+@@ -1536,6 +1537,15 @@
+       error = path_lookup(tmp, LOOKUP_PARENT, &nd);
+       if (error)
+               goto out;
++
++      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);
++              /* the file system wants to use normal vfs path now */
++              if (error != -EOPNOTSUPP)
++                      goto out2;
++      }
++
+       dentry = lookup_create(&nd, 0);
+       error = PTR_ERR(dentry);
+@@ -1562,6 +1572,7 @@
+               dput(dentry);
+       }
+       up(&nd.dentry->d_inode->i_sem);
++out2:
+       path_release(&nd);
+ out:
+       putname(tmp);
+@@ -1603,10 +1614,18 @@
+       if (!IS_ERR(tmp)) {
+               struct dentry *dentry;
+               struct nameidata nd;
++                intent_init(&nd.intent, IT_LOOKUP);
+               error = path_lookup(tmp, LOOKUP_PARENT, &nd);
+               if (error)
+                       goto out;
++              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);
++                      /* the file system wants to use normal vfs path now */
++                      if (error != -EOPNOTSUPP)
++                              goto out2;
++              }
+               dentry = lookup_create(&nd, 1);
+               error = PTR_ERR(dentry);
+               if (!IS_ERR(dentry)) {
+@@ -1616,6 +1635,7 @@
+                       dput(dentry);
+               }
+               up(&nd.dentry->d_inode->i_sem);
++out2:
+               path_release(&nd);
+ out:
+               putname(tmp);
+@@ -1696,6 +1716,7 @@
+       char * name;
+       struct dentry *dentry;
+       struct nameidata nd;
++        intent_init(&nd.intent, IT_LOOKUP);
+       name = getname(pathname);
+       if(IS_ERR(name))
+@@ -1716,6 +1737,16 @@
+                       error = -EBUSY;
+                       goto exit1;
+       }
++ 
++      if (nd.dentry->d_inode->i_op->rmdir_raw) {
++              struct inode_operations *op = nd.dentry->d_inode->i_op;
++ 
++              error = op->rmdir_raw(&nd);
++              /* the file system wants to use normal vfs path now */
++              if (error != -EOPNOTSUPP)
++                      goto exit1;
++      }
++ 
+       down(&nd.dentry->d_inode->i_sem);
+       dentry = lookup_hash(&nd.last, nd.dentry);
+       error = PTR_ERR(dentry);
+@@ -1774,6 +1805,7 @@
+       struct dentry *dentry;
+       struct nameidata nd;
+       struct inode *inode = NULL;
++        intent_init(&nd.intent, IT_LOOKUP);
+       name = getname(pathname);
+       if(IS_ERR(name))
+@@ -1785,6 +1817,13 @@
+       error = -EISDIR;
+       if (nd.last_type != LAST_NORM)
+               goto exit1;
++      if (nd.dentry->d_inode->i_op->unlink_raw) {
++              struct inode_operations *op = nd.dentry->d_inode->i_op;
++              error = op->unlink_raw(&nd);
++              /* the file system wants to use normal vfs path now */
++              if (error != -EOPNOTSUPP)
++                      goto exit1;
++      }
+       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)) {
+               struct dentry *dentry;
+               struct nameidata nd;
++                intent_init(&nd.intent, IT_LOOKUP);
+               error = path_lookup(to, LOOKUP_PARENT, &nd);
+               if (error)
+                       goto out;
++              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);
++                      /* the file system wants to use normal vfs path now */
++                      if (error != -EOPNOTSUPP)
++                              goto out2;
++              }
+               dentry = lookup_create(&nd, 0);
+               error = PTR_ERR(dentry);
+               if (!IS_ERR(dentry)) {
+@@ -1863,6 +1910,7 @@
+                       dput(dentry);
+               }
+               up(&nd.dentry->d_inode->i_sem);
++out2:
+               path_release(&nd);
+ out:
+               putname(to);
+@@ -1926,6 +1974,8 @@
+       struct nameidata nd, old_nd;
+       int error;
+       char * to;
++        intent_init(&nd.intent, IT_LOOKUP);
++        intent_init(&old_nd.intent, IT_LOOKUP);
+       to = getname(newname);
+       if (IS_ERR(to))
+@@ -1940,6 +1990,13 @@
+       error = -EXDEV;
+       if (old_nd.mnt != nd.mnt)
+               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);
++                /* the file system wants to use normal vfs path now */
++                if (error != -EOPNOTSUPP)
++                        goto out_release;
++        }
+       new_dentry = lookup_create(&nd, 0);
+       error = PTR_ERR(new_dentry);
+       if (!IS_ERR(new_dentry)) {
+@@ -1990,7 +2047,7 @@
+  *       locking].
+  */
+ int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry,
+-             struct inode *new_dir, struct dentry *new_dentry)
++                   struct inode *new_dir, struct dentry *new_dentry)
+ {
+       int error = 0;
+       struct inode *target;
+@@ -2035,7 +2092,7 @@
+ }
+ int vfs_rename_other(struct inode *old_dir, struct dentry *old_dentry,
+-             struct inode *new_dir, struct dentry *new_dentry)
++                     struct inode *new_dir, struct dentry *new_dentry)
+ {
+       struct inode *target;
+       int error;
+@@ -2112,6 +2169,8 @@
+       struct dentry * old_dentry, *new_dentry;
+       struct dentry * trap;
+       struct nameidata oldnd, newnd;
++        intent_init(&oldnd.intent, IT_LOOKUP);
++        intent_init(&newnd.intent, IT_LOOKUP);
+       error = path_lookup(oldname, LOOKUP_PARENT, &oldnd);
+       if (error)
+@@ -2134,6 +2193,13 @@
+       if (newnd.last_type != LAST_NORM)
+               goto exit2;
++      if (old_dir->d_inode->i_op->rename_raw) {
++              error = old_dir->d_inode->i_op->rename_raw(&oldnd, &newnd);
++              /* the file system wants to use normal vfs path now */
++              if (error != -EOPNOTSUPP)
++                      goto exit2;
++      }
++
+       trap = lock_rename(new_dir, old_dir);
+       old_dentry = lookup_hash(&oldnd.last, old_dir);
+@@ -2165,8 +2231,7 @@
+       if (new_dentry == trap)
+               goto exit5;
+-      error = vfs_rename(old_dir->d_inode, old_dentry,
+-                                 new_dir->d_inode, new_dentry);
++      error = vfs_rename(old_dir->d_inode, old_dentry, new_dir->d_inode, new_dentry);
+ exit5:
+       dput(new_dentry);
+ exit4:
+.old..........pc/vfs_nointent_2.6.0-suse/fs/open.c
+.new.........fs/open.c
+Index: linux-2.6.3-20/fs/open.c
+===================================================================
+--- linux-2.6.3-20.orig/fs/open.c      2004-03-08 14:23:40.000000000 -0800
++++ linux-2.6.3-20/fs/open.c   2004-03-08 14:40:01.000000000 -0800
+@@ -180,9 +180,10 @@
+       return error;
+ }
+-int do_truncate(struct dentry *dentry, loff_t length)
++int do_truncate(struct dentry *dentry, loff_t length, int called_from_open)
+ {
+       int err;
++      struct inode_operations *op = dentry->d_inode->i_op;
+       struct iattr newattrs;
+       /* Not pretty: "inode->i_size" shouldn't really be signed. But it is. */
+@@ -192,7 +193,14 @@
+       newattrs.ia_size = length;
+       newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME;
+       down(&dentry->d_inode->i_sem);
+-      err = notify_change(dentry, &newattrs);
++      if (called_from_open)
++              newattrs.ia_valid |= ATTR_FROM_OPEN;
++      if (op->setattr_raw) {
++              newattrs.ia_valid |= ATTR_RAW;
++              newattrs.ia_ctime = CURRENT_TIME;
++              err = op->setattr_raw(dentry->d_inode, &newattrs);
++      } else 
++                err = notify_change(dentry, &newattrs);
+       up(&dentry->d_inode->i_sem);
+       return err;
+ }
+@@ -247,7 +255,7 @@
+       error = locks_verify_truncate(inode, NULL, length);
+       if (!error) {
+               DQUOT_INIT(inode);
+-              error = do_truncate(nd.dentry, length);
++              error = do_truncate(nd.dentry, length, 0);
+       }
+       put_write_access(inode);
+@@ -299,7 +307,7 @@
+       error = locks_verify_truncate(inode, file, length);
+       if (!error)
+-              error = do_truncate(dentry, length);
++              error = do_truncate(dentry, length, 0);
+ out_putf:
+       fput(file);
+ out:
+@@ -378,9 +386,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:
+@@ -431,9 +449,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:
+@@ -634,6 +662,18 @@
+       if (IS_RDONLY(inode))
+               goto dput_and_out;
+       
++      if (inode->i_op->setattr_raw) {
++              struct inode_operations *op = nd.dentry->d_inode->i_op;
++
++              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 */
++              if (error != -EOPNOTSUPP)
++                      goto dput_and_out;
++      }
++
+       error = -EPERM;
+       if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
+               goto dput_and_out;
+@@ -667,6 +707,18 @@
+       if (IS_RDONLY(inode))
+               goto out;
+       error = -EPERM;
++      if (inode->i_op->setattr_raw) {
++              struct inode_operations *op = dentry->d_inode->i_op;
++
++              newattrs.ia_uid = user;
++              newattrs.ia_gid = group;
++              newattrs.ia_valid = ATTR_UID | ATTR_GID;
++              newattrs.ia_valid |= ATTR_RAW;
++              error = op->setattr_raw(inode, &newattrs);
++              /* the file system wants to use normal vfs path now */
++              if (error != -EOPNOTSUPP)
++                      return error;
++      }
+       if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
+               goto out;
+       newattrs.ia_valid =  ATTR_CTIME;
+@@ -680,6 +732,7 @@
+       }
+       if (!S_ISDIR(inode->i_mode))
+               newattrs.ia_valid |= ATTR_KILL_SUID|ATTR_KILL_SGID;
++
+       down(&inode->i_sem);
+       error = notify_change(dentry, &newattrs);
+       up(&inode->i_sem);
+.old..........pc/vfs_nointent_2.6.0-suse/fs/exec.c
+.new.........fs/exec.c
+Index: linux-2.6.3-20/fs/exec.c
+===================================================================
+--- linux-2.6.3-20.orig/fs/exec.c      2004-03-08 14:23:40.000000000 -0800
++++ linux-2.6.3-20/fs/exec.c   2004-03-08 14:40:01.000000000 -0800
+@@ -1406,7 +1406,7 @@
+               goto close_fail;
+       if (!file->f_op->write)
+               goto close_fail;
+-      if (do_truncate(file->f_dentry, 0) != 0)
++      if (do_truncate(file->f_dentry, 0, 0) != 0)
+               goto close_fail;
+       retval = binfmt->core_dump(signr, regs, file);
+.old..........pc/vfs_nointent_2.6.0-suse/include/linux/fs.h
+.new.........include/linux/fs.h
+Index: linux-2.6.3-20/include/linux/fs.h
+===================================================================
+--- linux-2.6.3-20.orig/include/linux/fs.h     2004-03-08 14:23:41.000000000 -0800
++++ linux-2.6.3-20/include/linux/fs.h  2004-03-08 14:42:10.000000000 -0800
+@@ -838,13 +838,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 *);
++      int (*link_raw) (struct nameidata *,struct nameidata *);
+       int (*unlink) (struct inode *,struct dentry *);
++      int (*unlink_raw) (struct nameidata *);
+       int (*symlink) (struct inode *,struct dentry *,const char *);
++      int (*symlink_raw) (struct nameidata *,const char *);
+       int (*mkdir) (struct inode *,struct dentry *,int);
++      int (*mkdir_raw) (struct nameidata *,int);
+       int (*rmdir) (struct inode *,struct dentry *);
++      int (*rmdir_raw) (struct nameidata *);
+       int (*mknod) (struct inode *,struct dentry *,int,dev_t);
++      int (*mknod_raw) (struct nameidata *,int,dev_t);
+       int (*rename) (struct inode *, struct dentry *,
+                       struct inode *, struct dentry *);
++      int (*rename_raw) (struct nameidata *, struct nameidata *);
+       int (*readlink) (struct dentry *, char __user *,int);
+       int (*follow_link) (struct dentry *, struct nameidata *);
+       void (*truncate) (struct inode *);
+@@ -1130,7 +1137,7 @@
+ /* fs/open.c */
+-extern int do_truncate(struct dentry *, loff_t start);
++extern int do_truncate(struct dentry *, loff_t start, int called_from_open);
+ 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 *);
+.old..........pc/vfs_nointent_2.6.0-suse/net/unix/af_unix.c
+.new.........net/unix/af_unix.c
+Index: linux-2.6.3-20/net/unix/af_unix.c
+===================================================================
+--- linux-2.6.3-20.orig/net/unix/af_unix.c     2004-03-05 02:07:04.000000000 -0800
++++ linux-2.6.3-20/net/unix/af_unix.c  2004-03-08 14:40:01.000000000 -0800
+@@ -592,6 +592,7 @@
+       int err = 0;
+       
+       if (sunname->sun_path[0]) {
++              intent_init(&nd.intent, IT_LOOKUP);
+               err = path_lookup(sunname->sun_path, LOOKUP_FOLLOW, &nd);
+               if (err)
+                       goto fail;
diff --git a/lustre/kernel_patches/series/suse-2.6.3 b/lustre/kernel_patches/series/suse-2.6.3
new file mode 100644 (file)
index 0000000..f2c17c0
--- /dev/null
@@ -0,0 +1,17 @@
+lustre_version.patch
+vfs_intent-2.6.3-suse.patch 
+vfs_nointent_2.6.3-suse.patch 
+vfs_races_2.5.72_rev1.patch
+ext3-wantedi-2.6.3.patch 
+ext3-san-jdike-2.5.73.patch
+nfs-cifs-intent-2.6.3-suse.patch
+iopen-2.6.0-test6.patch 
+export-truncate-2.5.63.patch 
+export_symbols-2.6.0.patch 
+ext3-map_inode_page-2.6.0.patch 
+removepage-2.6.0.patch
+dev_read_only_2.6.0.patch 
+kernel_text_address-2.6.3.patch 
+ext3-init-generation-2.6.0.patch 
+ext3-ea-in-inode-2.6.0.patch
+export-2.6.3.patch