Whamcloud - gitweb
merge b_devel -> b_eq: 20030909
authorericm <ericm>
Tue, 9 Sep 2003 14:37:14 +0000 (14:37 +0000)
committerericm <ericm>
Tue, 9 Sep 2003 14:37:14 +0000 (14:37 +0000)
only kernel pass sanity, liblustre still broken

13 files changed:
lustre/kernel_patches/patches/ext3-no-write-super.patch
lustre/kernel_patches/patches/extN-wantedi.patch
lustre/kernel_patches/patches/linux-2.4.20-xattr-0.8.54-chaos.patch
lustre/kernel_patches/patches/linux-2.4.20-xattr-0.8.54-hp.patch
lustre/kernel_patches/patches/linux-2.4.20-xattr-0.8.54.patch
lustre/kernel_patches/patches/vfs_intent-2.4.20-vanilla.patch
lustre/kernel_patches/series/chaos-2.4.20
lustre/kernel_patches/series/vanilla-2.4.20
lustre/ldlm/ldlm_lib.c
lustre/mdc/mdc_internal.h
lustre/mds/mds_lib.c
lustre/mgmt/mgmt_cli.c
lustre/ptlrpc/ptlrpc_lib.c

index b096276..d2dcdae 100644 (file)
@@ -1,16 +1,22 @@
+ 0 files changed
 
---- linux-2.4.18/fs/ext3/super.c~ext3-no-write-super   Mon Jul 28 14:13:05 2003
-+++ linux-2.4.18-alexey/fs/ext3/super.c        Mon Jul 28 16:14:11 2003
-@@ -1818,7 +1818,10 @@ void ext3_write_super (struct super_bloc
+--- linux-2.4.20/fs/ext3/super.c~ext3-no-write-super   2003-08-11 13:20:17.000000000 +0400
++++ linux-2.4.20-alexey/fs/ext3/super.c        2003-08-11 13:31:35.000000000 +0400
+@@ -1849,7 +1849,6 @@ void ext3_write_super (struct super_bloc
        if (down_trylock(&sb->s_lock) == 0)
-               BUG();
+               BUG();          /* aviro detector */
        sb->s_dirt = 0;
-+#if 0
-+      /* we really don't need this, jbd makes periodical commits by itself */
-       log_start_commit(EXT3_SB(sb)->s_journal, NULL);
-+#endif
- }
+-      target = log_start_commit(EXT3_SB(sb)->s_journal, NULL);
  
- static int ext3_sync_fs(struct super_block *sb)
+       /*
+        * Tricky --- if we are unmounting, the write really does need
+@@ -1857,6 +1856,7 @@ void ext3_write_super (struct super_bloc
+        * sb->s_root.
+        */
+       if (do_sync_supers || !sb->s_root) {
++              target = log_start_commit(EXT3_SB(sb)->s_journal, NULL);
+               unlock_super(sb);
+               log_wait_commit(EXT3_SB(sb)->s_journal, target);
+               lock_super(sb);
 
 _
index d40d678..c5772fb 100644 (file)
@@ -58,7 +58,7 @@
  {
        struct super_block * sb;
        struct buffer_head * bh;
-@@ -323,7 +324,39 @@ struct inode * ext3_new_inode (handle_t 
+@@ -323,7 +324,41 @@ struct inode * ext3_new_inode (handle_t 
        init_rwsem(&inode->u.ext3_i.truncate_sem);
  
        lock_super (sb);
 +              gdp = ext3_get_group_desc(sb, i, &bh2);
 +
 +              bitmap_nr = load_inode_bitmap (sb, i);
-+              if (bitmap_nr < 0)
++              if (bitmap_nr < 0) {
++                      err = bitmap_nr;
 +                      goto fail;
++              }
 +
 +              bh = EXT3_SB(sb)->s_inode_bitmap[bitmap_nr];
 +
index 6d8eac6..8c4da0b 100644 (file)
 +#endif
 +      if (error)
 +              return error;
-+  
++
 +      return ext2_xattr_set(inode, EXT2_XATTR_INDEX_USER, name,
 +                            value, size, flags);
 +}
 +#endif
 +      if (error)
 +              return error;
-+  
++
 +      handle = ext3_journal_start(inode, EXT3_XATTR_TRANS_BLOCKS);
 +      if (IS_ERR(handle))
 +              return PTR_ERR(handle);
index f0f92e5..5a5cad5 100644 (file)
 +#endif
 +      if (error)
 +              return error;
-+  
++
 +      return ext2_xattr_set(inode, EXT2_XATTR_INDEX_USER, name,
 +                            value, size, flags);
 +}
 +#endif
 +      if (error)
 +              return error;
-+  
++
 +      handle = ext3_journal_start(inode, EXT3_XATTR_TRANS_BLOCKS);
 +      if (IS_ERR(handle))
 +              return PTR_ERR(handle);
index 1489989..152e89a 100644 (file)
 +#endif
 +      if (error)
 +              return error;
-+  
++
 +      return ext2_xattr_set(inode, EXT2_XATTR_INDEX_USER, name,
 +                            value, size, flags);
 +}
 +#endif
 +      if (error)
 +              return error;
-+  
++
 +      handle = ext3_journal_start(inode, EXT3_XATTR_TRANS_BLOCKS);
 +      if (IS_ERR(handle))
 +              return PTR_ERR(handle);
index 6b98c05..434686d 100644 (file)
@@ -15,7 +15,7 @@
 Index: lum/fs/exec.c
 ===================================================================
 --- lum.orig/fs/exec.c 2003-08-07 05:11:15.000000000 -0600
-+++ lum/fs/exec.c      2003-08-07 05:14:57.000000000 -0600
++++ lum/fs/exec.c      2003-08-30 07:20:56.000000000 -0600
 @@ -107,8 +107,10 @@ asmlinkage long sys_uselib(const char * 
        struct file * file;
        struct nameidata nd;
@@ -80,7 +80,7 @@ Index: lum/fs/exec.c
 Index: lum/fs/dcache.c
 ===================================================================
 --- lum.orig/fs/dcache.c       2003-08-07 05:11:15.000000000 -0600
-+++ lum/fs/dcache.c    2003-08-07 05:11:20.000000000 -0600
++++ lum/fs/dcache.c    2003-08-30 07:20:56.000000000 -0600
 @@ -181,6 +181,13 @@ int d_invalidate(struct dentry * dentry)
                spin_unlock(&dcache_lock);
                return 0;
@@ -121,7 +121,7 @@ Index: lum/fs/dcache.c
 Index: lum/fs/namespace.c
 ===================================================================
 --- lum.orig/fs/namespace.c    2003-08-07 05:11:15.000000000 -0600
-+++ lum/fs/namespace.c 2003-08-07 05:11:20.000000000 -0600
++++ lum/fs/namespace.c 2003-08-30 07:20:56.000000000 -0600
 @@ -99,6 +99,7 @@ static void detach_mnt(struct vfsmount *
  {
        old_nd->dentry = mnt->mnt_mountpoint;
@@ -238,7 +238,7 @@ Index: lum/fs/namespace.c
 Index: lum/fs/namei.c
 ===================================================================
 --- lum.orig/fs/namei.c        2003-08-07 05:11:15.000000000 -0600
-+++ lum/fs/namei.c     2003-08-07 05:11:20.000000000 -0600
++++ lum/fs/namei.c     2003-08-30 07:21:03.000000000 -0600
 @@ -94,6 +94,13 @@
   * XEmacs seems to be relying on it...
   */
@@ -274,7 +274,7 @@ Index: lum/fs/namei.c
        if (dentry && dentry->d_op && dentry->d_op->d_revalidate) {
                if (!dentry->d_op->d_revalidate(dentry, flags) && !d_invalidate(dentry)) {
                        dput(dentry);
-@@ -281,11 +297,14 @@ static struct dentry * cached_lookup(str
+@@ -281,11 +297,15 @@ static struct dentry * cached_lookup(str
   * make sure that nobody added the entry to the dcache in the meantime..
   * SMP-safe
   */
@@ -284,13 +284,14 @@ Index: lum/fs/namei.c
  {
        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
-@@ -300,6 +319,9 @@ static struct dentry * real_lookup(struc
+@@ -300,6 +320,9 @@ static struct dentry * real_lookup(struc
                result = ERR_PTR(-ENOMEM);
                if (dentry) {
                        lock_kernel();
@@ -300,7 +301,7 @@ Index: lum/fs/namei.c
                        result = dir->i_op->lookup(dir, dentry);
                        unlock_kernel();
                        if (result)
-@@ -321,6 +343,12 @@ static struct dentry * real_lookup(struc
+@@ -321,6 +344,15 @@ static struct dentry * real_lookup(struc
                        dput(result);
                        result = ERR_PTR(-ENOENT);
                }
@@ -308,12 +309,15 @@ Index: lum/fs/namei.c
 +              if (!result->d_op->d_revalidate_it(result, flags, it) &&
 +                  !d_invalidate(result)) {
 +                      dput(result);
-+                      goto again;
++                        if (counter > 10)
++                                result = ERR_PTR(-ESTALE);
++                        if (!IS_ERR(result))
++                                goto again;
 +              }
        }
        return result;
  }
-@@ -332,7 +360,8 @@ static struct dentry * real_lookup(struc
+@@ -332,7 +364,8 @@ static struct dentry * real_lookup(struc
   * Without that kind of total limit, nasty chains of consecutive
   * symlinks can cause almost arbitrarily long lookups. 
   */
@@ -323,7 +327,7 @@ Index: lum/fs/namei.c
  {
        int err;
        if (current->link_count >= 5)
-@@ -346,10 +375,12 @@ static inline int do_follow_link(struct 
+@@ -346,10 +379,12 @@ static inline int do_follow_link(struct 
        current->link_count++;
        current->total_link_count++;
        UPDATE_ATIME(dentry->d_inode);
@@ -336,7 +340,7 @@ Index: lum/fs/namei.c
        path_release(nd);
        return -ELOOP;
  }
-@@ -447,7 +478,8 @@ static inline void follow_dotdot(struct 
+@@ -447,7 +482,8 @@ static inline void follow_dotdot(struct 
   *
   * We expect 'base' to be positive and a directory.
   */
@@ -346,7 +350,7 @@ Index: lum/fs/namei.c
  {
        struct dentry *dentry;
        struct inode *inode;
-@@ -520,9 +552,9 @@ int link_path_walk(const char * name, st
+@@ -520,9 +556,9 @@ int link_path_walk(const char * name, st
                                break;
                }
                /* This does the actual lookups.. */
@@ -358,7 +362,7 @@ Index: lum/fs/namei.c
                        err = PTR_ERR(dentry);
                        if (IS_ERR(dentry))
                                break;
-@@ -540,7 +572,7 @@ int link_path_walk(const char * name, st
+@@ -540,7 +576,7 @@ int link_path_walk(const char * name, st
                        goto out_dput;
  
                if (inode->i_op->follow_link) {
@@ -367,7 +371,7 @@ Index: lum/fs/namei.c
                        dput(dentry);
                        if (err)
                                goto return_err;
-@@ -556,7 +588,7 @@ int link_path_walk(const char * name, st
+@@ -556,7 +592,7 @@ int link_path_walk(const char * name, st
                        nd->dentry = dentry;
                }
                err = -ENOTDIR; 
@@ -376,7 +380,7 @@ Index: lum/fs/namei.c
                        break;
                continue;
                /* here ends the main loop */
-@@ -583,9 +615,9 @@ last_component:
+@@ -583,9 +619,9 @@ last_component:
                        if (err < 0)
                                break;
                }
@@ -388,7 +392,7 @@ Index: lum/fs/namei.c
                        err = PTR_ERR(dentry);
                        if (IS_ERR(dentry))
                                break;
-@@ -595,7 +627,7 @@ last_component:
+@@ -595,7 +631,7 @@ last_component:
                inode = dentry->d_inode;
                if ((lookup_flags & LOOKUP_FOLLOW)
                    && inode && inode->i_op && inode->i_op->follow_link) {
@@ -397,7 +401,7 @@ Index: lum/fs/namei.c
                        dput(dentry);
                        if (err)
                                goto return_err;
-@@ -609,7 +641,8 @@ last_component:
+@@ -609,7 +645,8 @@ last_component:
                        goto no_inode;
                if (lookup_flags & LOOKUP_DIRECTORY) {
                        err = -ENOTDIR; 
@@ -407,11 +411,10 @@ Index: lum/fs/namei.c
                                break;
                }
                goto return_base;
-@@ -633,6 +666,23 @@ return_reval:
+@@ -633,6 +670,21 @@ return_reval:
                 * Check the cached dentry for staleness.
                 */
                dentry = nd->dentry;
-+      revalidate_again:
 +              if (dentry && dentry->d_op && dentry->d_op->d_revalidate_it) {
 +                      err = -ESTALE;
 +                      if (!dentry->d_op->d_revalidate_it(dentry, 0, it)) {
@@ -425,13 +428,12 @@ Index: lum/fs/namei.c
 +                              d_invalidate(dentry);
 +                              dput(dentry);
 +                              dentry = new;
-+                              goto revalidate_again;
 +                      }
 +              } else
                if (dentry && dentry->d_op && dentry->d_op->d_revalidate) {
                        err = -ESTALE;
                        if (!dentry->d_op->d_revalidate(dentry, 0)) {
-@@ -646,15 +696,28 @@ out_dput:
+@@ -646,15 +698,28 @@ out_dput:
                dput(dentry);
                break;
        }
@@ -461,7 +463,7 @@ Index: lum/fs/namei.c
  }
  
  /* SMP-safe */
-@@ -739,6 +802,17 @@ walk_init_root(const char *name, struct 
+@@ -739,6 +804,17 @@ walk_init_root(const char *name, struct 
  }
  
  /* SMP-safe */
@@ -479,7 +481,7 @@ Index: lum/fs/namei.c
  int path_lookup(const char *path, unsigned flags, struct nameidata *nd)
  {
        int error = 0;
-@@ -753,6 +827,7 @@ int path_init(const char *name, unsigned
+@@ -753,6 +829,7 @@ int path_init(const char *name, unsigned
  {
        nd->last_type = LAST_ROOT; /* if there are only slashes... */
        nd->flags = flags;
@@ -487,7 +489,7 @@ Index: lum/fs/namei.c
        if (*name=='/')
                return walk_init_root(name,nd);
        read_lock(&current->fs->lock);
-@@ -767,7 +842,8 @@ int path_init(const char *name, unsigned
+@@ -767,7 +844,8 @@ int path_init(const char *name, unsigned
   * needs parent already locked. Doesn't follow mounts.
   * SMP-safe.
   */
@@ -497,7 +499,7 @@ Index: lum/fs/namei.c
  {
        struct dentry * dentry;
        struct inode *inode;
-@@ -790,13 +866,16 @@ struct dentry * lookup_hash(struct qstr 
+@@ -790,13 +868,16 @@ struct dentry * lookup_hash(struct qstr 
                        goto out;
        }
  
@@ -515,7 +517,7 @@ Index: lum/fs/namei.c
                dentry = inode->i_op->lookup(inode, new);
                unlock_kernel();
                if (!dentry)
-@@ -808,6 +887,12 @@ out:
+@@ -808,6 +889,12 @@ out:
        return dentry;
  }
  
@@ -528,7 +530,7 @@ Index: lum/fs/namei.c
  /* SMP-safe */
  struct dentry * lookup_one_len(const char * name, struct dentry * base, int len)
  {
-@@ -829,7 +914,7 @@ struct dentry * lookup_one_len(const cha
+@@ -829,7 +916,7 @@ struct dentry * lookup_one_len(const cha
        }
        this.hash = end_name_hash(hash);
  
@@ -537,7 +539,7 @@ Index: lum/fs/namei.c
  access:
        return ERR_PTR(-EACCES);
  }
-@@ -860,6 +945,23 @@ int __user_walk(const char *name, unsign
+@@ -860,6 +947,23 @@ int __user_walk(const char *name, unsign
        return err;
  }
  
@@ -561,7 +563,7 @@ Index: lum/fs/namei.c
  /*
   * It's inline, so penalty for filesystems that don't use sticky bit is
   * minimal.
-@@ -955,7 +1057,8 @@ static inline int lookup_flags(unsigned 
+@@ -955,7 +1059,8 @@ static inline int lookup_flags(unsigned 
        return retval;
  }
  
@@ -571,7 +573,7 @@ Index: lum/fs/namei.c
  {
        int error;
  
-@@ -968,12 +1071,15 @@ int vfs_create(struct inode *dir, struct
+@@ -968,12 +1073,15 @@ int vfs_create(struct inode *dir, struct
                goto exit_lock;
  
        error = -EACCES;        /* shouldn't it be ENOSYS? */
@@ -589,7 +591,7 @@ Index: lum/fs/namei.c
        unlock_kernel();
  exit_lock:
        up(&dir->i_zombie);
-@@ -982,6 +1088,11 @@ exit_lock:
+@@ -982,6 +1090,11 @@ exit_lock:
        return error;
  }
  
@@ -601,7 +603,7 @@ Index: lum/fs/namei.c
  /*
   *    open_namei()
   *
-@@ -996,7 +1107,8 @@ exit_lock:
+@@ -996,7 +1109,8 @@ exit_lock:
   * for symlinks (where the permissions are checked later).
   * SMP-safe
   */
@@ -611,7 +613,7 @@ Index: lum/fs/namei.c
  {
        int acc_mode, error = 0;
        struct inode *inode;
-@@ -1006,11 +1118,14 @@ int open_namei(const char * pathname, in
+@@ -1006,11 +1120,14 @@ int open_namei(const char * pathname, in
  
        acc_mode = ACC_MODE(flag);
  
@@ -627,7 +629,7 @@ Index: lum/fs/namei.c
                if (error)
                        return error;
                dentry = nd->dentry;
-@@ -1020,6 +1135,10 @@ int open_namei(const char * pathname, in
+@@ -1020,6 +1137,10 @@ int open_namei(const char * pathname, in
        /*
         * Create - we need to know the parent.
         */
@@ -638,7 +640,7 @@ Index: lum/fs/namei.c
        error = path_lookup(pathname, LOOKUP_PARENT, nd);
        if (error)
                return error;
-@@ -1035,7 +1154,7 @@ int open_namei(const char * pathname, in
+@@ -1035,7 +1156,7 @@ int open_namei(const char * pathname, in
  
        dir = nd->dentry;
        down(&dir->d_inode->i_sem);
@@ -647,7 +649,7 @@ Index: lum/fs/namei.c
  
  do_last:
        error = PTR_ERR(dentry);
-@@ -1044,10 +1163,11 @@ do_last:
+@@ -1044,10 +1165,11 @@ do_last:
                goto exit;
        }
  
@@ -661,7 +663,7 @@ Index: lum/fs/namei.c
                up(&dir->d_inode->i_sem);
                dput(nd->dentry);
                nd->dentry = dentry;
-@@ -1151,7 +1271,7 @@ ok:
+@@ -1151,7 +1273,7 @@ ok:
                if (!error) {
                        DQUOT_INIT(inode);
                        
@@ -670,7 +672,7 @@ Index: lum/fs/namei.c
                }
                put_write_access(inode);
                if (error)
-@@ -1163,8 +1283,10 @@ ok:
+@@ -1163,8 +1285,10 @@ ok:
        return 0;
  
  exit_dput:
@@ -681,7 +683,7 @@ Index: lum/fs/namei.c
        path_release(nd);
        return error;
  
-@@ -1183,7 +1305,10 @@ do_link:
+@@ -1183,7 +1307,10 @@ do_link:
         * are done. Procfs-like symlinks just set LAST_BIND.
         */
        UPDATE_ATIME(dentry->d_inode);
@@ -692,7 +694,7 @@ Index: lum/fs/namei.c
        dput(dentry);
        if (error)
                return error;
-@@ -1205,13 +1330,20 @@ do_link:
+@@ -1205,13 +1332,20 @@ do_link:
        }
        dir = nd->dentry;
        down(&dir->d_inode->i_sem);
@@ -715,7 +717,7 @@ Index: lum/fs/namei.c
  {
        struct dentry *dentry;
  
-@@ -1219,7 +1351,7 @@ static struct dentry *lookup_create(stru
+@@ -1219,7 +1353,7 @@ static struct dentry *lookup_create(stru
        dentry = ERR_PTR(-EEXIST);
        if (nd->last_type != LAST_NORM)
                goto fail;
@@ -724,7 +726,7 @@ Index: lum/fs/namei.c
        if (IS_ERR(dentry))
                goto fail;
        if (!is_dir && nd->last.name[nd->last.len] && !dentry->d_inode)
-@@ -1275,7 +1407,16 @@ asmlinkage long sys_mknod(const char * f
+@@ -1275,7 +1409,16 @@ asmlinkage long sys_mknod(const char * f
        error = path_lookup(tmp, LOOKUP_PARENT, &nd);
        if (error)
                goto out;
@@ -742,7 +744,7 @@ Index: lum/fs/namei.c
        error = PTR_ERR(dentry);
  
        mode &= ~current->fs->umask;
-@@ -1296,6 +1437,7 @@ asmlinkage long sys_mknod(const char * f
+@@ -1296,6 +1439,7 @@ asmlinkage long sys_mknod(const char * f
                dput(dentry);
        }
        up(&nd.dentry->d_inode->i_sem);
@@ -750,7 +752,7 @@ Index: lum/fs/namei.c
        path_release(&nd);
  out:
        putname(tmp);
-@@ -1343,7 +1485,14 @@ asmlinkage long sys_mkdir(const char * p
+@@ -1343,7 +1487,14 @@ asmlinkage long sys_mkdir(const char * p
                error = path_lookup(tmp, LOOKUP_PARENT, &nd);
                if (error)
                        goto out;
@@ -766,7 +768,7 @@ Index: lum/fs/namei.c
                error = PTR_ERR(dentry);
                if (!IS_ERR(dentry)) {
                        error = vfs_mkdir(nd.dentry->d_inode, dentry,
-@@ -1351,6 +1500,7 @@ asmlinkage long sys_mkdir(const char * p
+@@ -1351,6 +1502,7 @@ asmlinkage long sys_mkdir(const char * p
                        dput(dentry);
                }
                up(&nd.dentry->d_inode->i_sem);
@@ -774,7 +776,7 @@ Index: lum/fs/namei.c
                path_release(&nd);
  out:
                putname(tmp);
-@@ -1451,8 +1601,16 @@ asmlinkage long sys_rmdir(const char * p
+@@ -1451,8 +1603,16 @@ asmlinkage long sys_rmdir(const char * p
                        error = -EBUSY;
                        goto exit1;
        }
@@ -792,7 +794,7 @@ Index: lum/fs/namei.c
        error = PTR_ERR(dentry);
        if (!IS_ERR(dentry)) {
                error = vfs_rmdir(nd.dentry->d_inode, dentry);
-@@ -1510,8 +1668,15 @@ asmlinkage long sys_unlink(const char * 
+@@ -1510,8 +1670,15 @@ asmlinkage long sys_unlink(const char * 
        error = -EISDIR;
        if (nd.last_type != LAST_NORM)
                goto exit1;
@@ -809,7 +811,7 @@ Index: lum/fs/namei.c
        error = PTR_ERR(dentry);
        if (!IS_ERR(dentry)) {
                /* Why not before? Because we want correct error value */
-@@ -1578,15 +1743,23 @@ asmlinkage long sys_symlink(const char *
+@@ -1578,15 +1745,23 @@ asmlinkage long sys_symlink(const char *
                error = path_lookup(to, LOOKUP_PARENT, &nd);
                if (error)
                        goto out;
@@ -835,7 +837,7 @@ Index: lum/fs/namei.c
                putname(to);
        }
        putname(from);
-@@ -1662,7 +1835,14 @@ asmlinkage long sys_link(const char * ol
+@@ -1662,7 +1837,14 @@ asmlinkage long sys_link(const char * ol
                error = -EXDEV;
                if (old_nd.mnt != nd.mnt)
                        goto out_release;
@@ -851,7 +853,7 @@ Index: lum/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);
-@@ -1706,7 +1886,7 @@ exit:
+@@ -1706,7 +1888,7 @@ exit:
   *       locking].
   */
  int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry,
@@ -860,7 +862,7 @@ Index: lum/fs/namei.c
  {
        int error;
        struct inode *target;
-@@ -1785,7 +1965,7 @@ out_unlock:
+@@ -1785,7 +1967,7 @@ out_unlock:
  }
  
  int vfs_rename_other(struct inode *old_dir, struct dentry *old_dentry,
@@ -869,7 +871,7 @@ Index: lum/fs/namei.c
  {
        int error;
  
-@@ -1873,9 +2053,18 @@ static inline int do_rename(const char *
+@@ -1873,9 +2055,18 @@ static inline int do_rename(const char *
        if (newnd.last_type != LAST_NORM)
                goto exit2;
  
@@ -889,7 +891,7 @@ Index: lum/fs/namei.c
        error = PTR_ERR(old_dentry);
        if (IS_ERR(old_dentry))
                goto exit3;
-@@ -1891,16 +2080,16 @@ static inline int do_rename(const char *
+@@ -1891,16 +2082,16 @@ static inline int do_rename(const char *
                if (newnd.last.name[newnd.last.len])
                        goto exit4;
        }
@@ -908,7 +910,7 @@ Index: lum/fs/namei.c
        dput(new_dentry);
  exit4:
        dput(old_dentry);
-@@ -1951,20 +2140,26 @@ out:
+@@ -1951,20 +2142,26 @@ out:
  }
  
  static inline int
@@ -937,7 +939,7 @@ Index: lum/fs/namei.c
  out:
        if (current->link_count || res || nd->last_type!=LAST_NORM)
                return res;
-@@ -1986,7 +2181,13 @@ fail:
+@@ -1986,7 +2183,13 @@ fail:
  
  int vfs_follow_link(struct nameidata *nd, const char *link)
  {
@@ -952,7 +954,7 @@ Index: lum/fs/namei.c
  }
  
  /* get the link contents into pagecache */
-@@ -2028,7 +2229,7 @@ int page_follow_link(struct dentry *dent
+@@ -2028,7 +2231,7 @@ int page_follow_link(struct dentry *dent
  {
        struct page *page = NULL;
        char *s = page_getlink(dentry, &page);
@@ -964,7 +966,7 @@ Index: lum/fs/namei.c
 Index: lum/fs/open.c
 ===================================================================
 --- lum.orig/fs/open.c 2003-08-07 05:11:15.000000000 -0600
-+++ lum/fs/open.c      2003-08-08 05:30:13.000000000 -0600
++++ lum/fs/open.c      2003-08-30 07:20:56.000000000 -0600
 @@ -19,6 +19,8 @@
  #include <asm/uaccess.h>
  
@@ -1371,7 +1373,7 @@ Index: lum/fs/open.c
 Index: lum/fs/stat.c
 ===================================================================
 --- lum.orig/fs/stat.c 2003-08-07 05:11:15.000000000 -0600
-+++ lum/fs/stat.c      2003-08-07 05:11:20.000000000 -0600
++++ lum/fs/stat.c      2003-08-30 07:20:56.000000000 -0600
 @@ -17,10 +17,12 @@
   * Revalidate the inode. This is required for proper NFS attribute caching.
   */
@@ -1532,7 +1534,7 @@ Index: lum/fs/stat.c
 Index: lum/include/linux/dcache.h
 ===================================================================
 --- lum.orig/include/linux/dcache.h    2003-08-07 05:11:15.000000000 -0600
-+++ lum/include/linux/dcache.h 2003-08-07 05:16:55.000000000 -0600
++++ lum/include/linux/dcache.h 2003-08-30 07:20:56.000000000 -0600
 @@ -7,6 +7,50 @@
  #include <linux/mount.h>
  #include <linux/kernel.h>
@@ -1617,8 +1619,8 @@ Index: lum/include/linux/dcache.h
  
 Index: lum/include/linux/fs.h
 ===================================================================
---- lum.orig/include/linux/fs.h        2003-08-07 05:11:20.000000000 -0600
-+++ lum/include/linux/fs.h     2003-08-07 05:13:52.000000000 -0600
+--- lum.orig/include/linux/fs.h        2003-08-30 07:20:55.000000000 -0600
++++ lum/include/linux/fs.h     2003-08-30 07:20:56.000000000 -0600
 @@ -73,6 +73,7 @@ extern int leases_enable, dir_notify_ena
  
  #define FMODE_READ 1
@@ -1741,7 +1743,7 @@ Index: lum/include/linux/fs.h
 Index: lum/include/linux/fs_struct.h
 ===================================================================
 --- lum.orig/include/linux/fs_struct.h 2003-08-07 05:11:15.000000000 -0600
-+++ lum/include/linux/fs_struct.h      2003-08-07 05:11:20.000000000 -0600
++++ lum/include/linux/fs_struct.h      2003-08-30 07:20:56.000000000 -0600
 @@ -34,10 +34,12 @@ static inline void set_fs_root(struct fs
        write_lock(&fs->lock);
        old_root = fs->root;
@@ -1770,8 +1772,8 @@ Index: lum/include/linux/fs_struct.h
        }
 Index: lum/kernel/ksyms.c
 ===================================================================
---- lum.orig/kernel/ksyms.c    2003-08-07 05:11:20.000000000 -0600
-+++ lum/kernel/ksyms.c 2003-08-07 05:11:20.000000000 -0600
+--- lum.orig/kernel/ksyms.c    2003-08-30 07:20:55.000000000 -0600
++++ lum/kernel/ksyms.c 2003-08-30 07:20:56.000000000 -0600
 @@ -269,6 +269,7 @@ EXPORT_SYMBOL(read_cache_page);
  EXPORT_SYMBOL(set_page_dirty);
  EXPORT_SYMBOL(vfs_readlink);
@@ -1783,7 +1785,7 @@ Index: lum/kernel/ksyms.c
 Index: lum/kernel/fork.c
 ===================================================================
 --- lum.orig/kernel/fork.c     2003-08-07 05:11:15.000000000 -0600
-+++ lum/kernel/fork.c  2003-08-07 05:11:20.000000000 -0600
++++ lum/kernel/fork.c  2003-08-30 07:20:56.000000000 -0600
 @@ -384,10 +384,13 @@ static inline struct fs_struct *__copy_f
                fs->umask = old->umask;
                read_lock(&old->lock);
@@ -1801,7 +1803,7 @@ Index: lum/kernel/fork.c
 Index: lum/kernel/exit.c
 ===================================================================
 --- lum.orig/kernel/exit.c     2003-08-07 05:11:15.000000000 -0600
-+++ lum/kernel/exit.c  2003-08-07 05:11:20.000000000 -0600
++++ lum/kernel/exit.c  2003-08-30 07:20:56.000000000 -0600
 @@ -238,11 +238,14 @@ static inline void __put_fs_struct(struc
  {
        /* No need to hold fs->lock if we are killing it */
index 0ab5554..f7a209f 100644 (file)
@@ -22,3 +22,6 @@ ext3-error-export.patch
 iopen-2.4.20.patch
 tcp_zero_copy_2.4.20_chaos.patch
 gpl_header-chaos-2.4.20.patch
+add_page_private.patch
+jbd-flushtime.patch
+jbd-get_write_access.patch
index 726a028..e3f4bd1 100644 (file)
@@ -29,3 +29,12 @@ ext3-map_inode_page.patch
 ext3-error-export.patch
 iopen-2.4.20.patch
 tcp-zero-copy.patch
+jbd-dont-account-blocks-twice.patch
+jbd-commit-tricks.patch
+ext3-no-write-super.patch
+add_page_private.patch
+socket-exports-vanilla.patch
+removepage-2.4.20.patch
+jbd-ctx_switch.patch
+jbd-flushtime.patch
+jbd-get_write_access.patch
index a172d38..b5e6be5 100644 (file)
@@ -52,6 +52,7 @@ int client_connect_import(struct lustre_handle *dlm_handle,
         cli->cl_conn_count++;
         if (cli->cl_conn_count > 1)
                 GOTO(out_sem, rc);
+        exp = class_conn2export(dlm_handle);
 
         if (obd->obd_namespace != NULL)
                 CERROR("already have namespace!\n");
@@ -71,9 +72,7 @@ int client_connect_import(struct lustre_handle *dlm_handle,
 
         LASSERT (imp->imp_state == LUSTRE_IMP_FULL);
 
-        exp = class_conn2export(dlm_handle);
         exp->exp_connection = ptlrpc_connection_addref(imp->imp_connection);
-        class_export_put(exp);
 
         if (imp->imp_replayable) {
                 CDEBUG(D_HA, "connected to replayable target: %s\n",
@@ -92,24 +91,27 @@ out_ldlm:
                 obd->obd_namespace = NULL;
 out_disco:
                 cli->cl_conn_count--;
-                class_disconnect(dlm_handle, 0);
+                class_disconnect(exp, 0);
+        } else {
+                class_export_put(exp);
         }
 out_sem:
         up(&cli->cl_sem);
         return rc;
 }
 
-int client_disconnect_import(struct lustre_handle *dlm_handle, int failover)
+int client_disconnect_export(struct obd_export *exp, int failover)
 {
-        struct obd_device *obd = class_conn2obd(dlm_handle);
+        struct obd_device *obd = class_exp2obd(exp);
         struct client_obd *cli = &obd->u.cli;
         struct obd_import *imp = cli->cl_import;
         int rc = 0, err;
         ENTRY;
 
         if (!obd) {
-                CERROR("invalid connection for disconnect: cookie "LPX64"\n",
-                       dlm_handle ? dlm_handle->cookie : -1UL);
+                CERROR("invalid export for disconnect: "
+                       "exp %p cookie "LPX64"\n", exp, 
+                       exp ? exp->exp_handle.h_cookie : -1UL);
                 RETURN(-EINVAL);
         }
 
@@ -136,19 +138,16 @@ int client_disconnect_import(struct lustre_handle *dlm_handle, int failover)
         }
 
         /* Yeah, obd_no_recov also (mainly) means "forced shutdown". */
-        if (obd->obd_no_recov) {
+        if (obd->obd_no_recov)
                 ptlrpc_set_import_active(imp, 0);
-        } else {
+        else
                 rc = ptlrpc_disconnect_import(imp);
-        }
-        
-        imp->imp_state = LUSTRE_IMP_NEW;
 
+        imp->imp_state = LUSTRE_IMP_NEW;
 
         EXIT;
-
  out_no_disconnect:
-        err = class_disconnect(dlm_handle, 0);
+        err = class_disconnect(exp, 0);
         if (!rc && err)
                 rc = err;
  out_sem:
@@ -353,7 +352,7 @@ out:
 
 int target_handle_disconnect(struct ptlrpc_request *req)
 {
-        struct lustre_handle *conn = &req->rq_reqmsg->handle;
+        struct obd_export *export;
         struct obd_import *dlmimp;
         int rc;
         ENTRY;
@@ -362,7 +361,10 @@ int target_handle_disconnect(struct ptlrpc_request *req)
         if (rc)
                 RETURN(rc);
 
-        req->rq_status = obd_disconnect(conn, 0);
+        /* Create an export reference to disconnect, so the rq_export
+         * ref is not destroyed. See class_disconnect() for more info. */
+        export = class_export_get(req->rq_export);
+        req->rq_status = obd_disconnect(export, 0);
 
         dlmimp = req->rq_export->exp_ldlm_data.led_import;
         class_destroy_import(dlmimp);
@@ -436,9 +438,16 @@ void target_abort_recovery(void *data)
 
         obd->obd_recovering = obd->obd_abort_recovery = 0;
         obd->obd_recoverable_clients = 0;
+
         wake_up(&obd->obd_next_transno_waitq);
         target_cancel_recovery_timer(obd);
         spin_unlock_bh(&obd->obd_processing_task_lock);
+
+        /* XXX can't call this with spin_lock_bh, but it probably
+           should be protected, somehow. */
+        if (OBT(obd) && OBP(obd, postsetup))
+                OBP(obd, postsetup)(obd);
+
         class_disconnect_exports(obd, 0);
         abort_delayed_replies(obd);
         abort_recovery_queue(obd);
@@ -492,12 +501,16 @@ static int check_for_next_transno(struct obd_device *obd)
         struct ptlrpc_request *req;
         int wake_up;
 
+        /* XXX shouldn't we take obd->obd_processing_task_lock to check these
+           flags and the recovery_queue? */
+        if (obd->obd_abort_recovery || !obd->obd_recovering)
+                return 1;
+
         req = list_entry(obd->obd_recovery_queue.next,
                          struct ptlrpc_request, rq_list);
         LASSERT(req->rq_reqmsg->transno >= obd->obd_next_recovery_transno);
 
-        wake_up = req->rq_reqmsg->transno == obd->obd_next_recovery_transno ||
-                (obd->obd_recovering) == 0;
+        wake_up = req->rq_reqmsg->transno == obd->obd_next_recovery_transno;
         CDEBUG(D_HA, "check_for_next_transno: "LPD64" vs "LPD64", %d == %d\n",
                req->rq_reqmsg->transno, obd->obd_next_recovery_transno,
                obd->obd_recovering, wake_up);
@@ -696,6 +709,10 @@ int target_queue_final_reply(struct ptlrpc_request *req, int rc)
                 CERROR("%s: all clients recovered, sending delayed replies\n",
                        obd->obd_name);
                 obd->obd_recovering = 0;
+
+                if (OBT(obd) && OBP(obd, postsetup))
+                        OBP(obd, postsetup)(obd);
+
                 list_for_each_safe(tmp, n, &obd->obd_delayed_reply_queue) {
                         req = list_entry(tmp, struct ptlrpc_request, rq_list);
                         DEBUG_REQ(D_ERROR, req, "delayed:");
@@ -857,3 +874,5 @@ int target_handle_ping(struct ptlrpc_request *req)
 {
         return lustre_pack_reply (req, 0, NULL, NULL);
 }
+
+
index 0ac87a4..6d212fd 100644 (file)
@@ -23,3 +23,47 @@ void mdc_link_pack(struct ptlrpc_request *req, int offset,
 void mdc_rename_pack(struct ptlrpc_request *req, int offset,
                      struct mdc_op_data *data,
                      const char *old, int oldlen, const char *new, int newlen);
+
+struct mdc_open_data {
+        struct obd_client_handle *mod_och;
+        struct ptlrpc_request    *mod_close_req;
+};
+
+struct mdc_rpc_lock {
+        struct semaphore rpcl_sem;
+        struct lookup_intent *rpcl_it;
+};
+
+static inline void mdc_init_rpc_lock(struct mdc_rpc_lock *lck)
+{
+        sema_init(&lck->rpcl_sem, 1);
+        lck->rpcl_it = NULL;
+}
+
+#ifdef __KERNEL__
+static inline void mdc_get_rpc_lock(struct mdc_rpc_lock *lck, 
+                                    struct lookup_intent *it)
+{
+        ENTRY;
+        down(&lck->rpcl_sem);
+        if (it) { 
+                lck->rpcl_it = it;
+        }
+}
+
+static inline void mdc_put_rpc_lock(struct mdc_rpc_lock *lck, 
+                                    struct lookup_intent *it)
+{
+        EXIT;
+        if (it == NULL) {
+                LASSERT(it == lck->rpcl_it);
+                up(&lck->rpcl_sem);
+                return;
+        }
+        if (it) {
+                LASSERT(it == lck->rpcl_it);
+                lck->rpcl_it = NULL;
+                up(&lck->rpcl_sem);
+        }
+}
+#endif
index ddd752a..a9b6f3f 100644 (file)
@@ -48,7 +48,6 @@
 #include <linux/obd_support.h>
 #include <linux/lustre_lib.h>
 #include <linux/lustre_mds.h>
-#include <linux/lustre_lite.h>
 
 void mds_pack_inode2fid(struct ll_fid *fid, struct inode *inode)
 {
@@ -60,7 +59,7 @@ void mds_pack_inode2fid(struct ll_fid *fid, struct inode *inode)
 /* Note that we can copy all of the fields, just some will not be "valid" */
 void mds_pack_inode2body(struct mds_body *b, struct inode *inode)
 {
-        b->valid = OBD_MD_FLID | OBD_MD_FLCTIME | OBD_MD_FLUID | OBD_MD_FLGID |
+        b->valid |= OBD_MD_FLID | OBD_MD_FLCTIME | OBD_MD_FLUID | OBD_MD_FLGID |
                 OBD_MD_FLTYPE | OBD_MD_FLMODE | OBD_MD_FLNLINK | OBD_MD_FLGENER;
 
         if (!S_ISREG(inode->i_mode))
@@ -267,6 +266,45 @@ static int mds_rename_unpack(struct ptlrpc_request *req, int offset,
         RETURN(0);
 }
 
+static int mds_open_unpack(struct ptlrpc_request *req, int offset,
+                           struct mds_update_record *r)
+{
+        struct mds_rec_create *rec;
+        ENTRY;
+
+        rec = lustre_swab_reqbuf (req, offset, sizeof (*rec),
+                                  lustre_swab_mds_rec_create);
+        if (rec == NULL)
+                RETURN (-EFAULT);
+
+        r->ur_fsuid = rec->cr_fsuid;
+        r->ur_fsgid = rec->cr_fsgid;
+        r->ur_cap = rec->cr_cap;
+        r->ur_fid1 = &rec->cr_fid;
+        r->ur_fid2 = &rec->cr_replayfid;
+        r->ur_mode = rec->cr_mode;
+        r->ur_rdev = rec->cr_rdev;
+        r->ur_time = rec->cr_time;
+        r->ur_flags = rec->cr_flags;
+        r->ur_suppgid1 = rec->cr_suppgid;
+        r->ur_suppgid2 = -1;
+
+        LASSERT_REQSWAB (req, offset + 1);
+        r->ur_name = lustre_msg_string (req->rq_reqmsg, offset + 1, 0);
+        if (r->ur_name == NULL)
+                RETURN (-EFAULT);
+        r->ur_namelen = req->rq_reqmsg->buflens[offset + 1];
+
+        LASSERT_REQSWAB (req, offset + 2);
+        if (req->rq_reqmsg->bufcount > offset + 2) {
+                r->ur_eadata = lustre_msg_buf(req->rq_reqmsg, offset + 2, 0);
+                if (r->ur_eadata == NULL)
+                        RETURN (-EFAULT);
+                r->ur_eadatalen = req->rq_reqmsg->buflens[offset + 2];
+        }
+        RETURN(0);
+}
+
 typedef int (*update_unpacker)(struct ptlrpc_request *req, int offset,
                                struct mds_update_record *r);
 
@@ -276,7 +314,7 @@ static update_unpacker mds_unpackers[REINT_MAX + 1] = {
         [REINT_LINK] mds_link_unpack,
         [REINT_UNLINK] mds_unlink_unpack,
         [REINT_RENAME] mds_rename_unpack,
-        [REINT_OPEN] mds_create_unpack,
+        [REINT_OPEN] mds_open_unpack,
 };
 
 int mds_update_unpack(struct ptlrpc_request *req, int offset,
index 9d4183a..5cbcfae 100644 (file)
@@ -101,20 +101,22 @@ static int mgmtcli_connect_to_svc(struct obd_device *obd)
         struct ptlrpc_svc_data svc_data;
         struct ptlrpc_thread *thread;
         struct l_wait_info lwi = { 0 };
+        struct lustre_handle conn = {0, };
         ENTRY;
 
         /* Connect to ourselves, and thusly to the mgmt service. */
-        rc = client_connect_import(&mc->mc_ping_handle, obd, &obd->obd_uuid);
+        rc = client_connect_import(&conn, obd, &obd->obd_uuid);
         if (rc) {
                 CERROR("failed to connect to mgmt svc: %d\n", rc);
                 (void)client_obd_cleanup(obd, 0);
                 RETURN(rc);
         }
+        mc->mc_ping_exp = class_conn2export(&conn);
         
         LASSERT(mc->mc_ping_thread == NULL);
         OBD_ALLOC(thread, sizeof (*thread));
         if (thread == NULL)
-                RETURN(-ENOMEM);
+                GOTO(out, rc = -ENOMEM);
         mc->mc_ping_thread = thread;
         init_waitqueue_head(&thread->t_ctl_waitq);
 
@@ -122,11 +124,12 @@ static int mgmtcli_connect_to_svc(struct obd_device *obd)
         svc_data.thread = thread;
 
         rc = kernel_thread(mgmtcli_pinger_main, &svc_data, CLONE_VM | CLONE_FILES);
+out:
         if (rc < 0) {
                 CERROR("can't start thread to ping mgmt svc %s: %d\n",
                        mc->mc_import->imp_target_uuid.uuid, rc);
                 OBD_FREE(mc->mc_ping_thread, sizeof (*mc->mc_ping_thread));
-                (void)client_disconnect_import(&mc->mc_ping_handle, 0);
+                (void)client_disconnect_import(mc->mc_ping_exp, 0);
                 RETURN(rc);
         }
         l_wait_event(thread->t_ctl_waitq, thread->t_flags & SVC_RUNNING, &lwi);
@@ -143,7 +146,7 @@ static int mgmtcli_disconnect_from_svc(struct obd_device *obd)
         int rc;
 
         ENTRY;
-        rc = client_disconnect_import(&mc->mc_ping_handle, 0);
+        rc = client_disconnect_import(mc->mc_ping_exp, 0);
         if (rc) {
                 CERROR("can't disconnect from %s: %d (%s)\n",
                        imp->imp_target_uuid.uuid, rc,
index f45f352..8ae2c6e 100644 (file)
@@ -94,7 +94,17 @@ int client_obd_setup(struct obd_device *obddev, obd_count len, void *buf)
         init_MUTEX(&cli->cl_dirty_sem);
         cli->cl_dirty = 0;
         cli->cl_dirty_granted = 0;
+        cli->cl_dirty_max = 64*1024*1024; /* some default */
         cli->cl_ost_can_grant = 1;
+        INIT_LIST_HEAD(&cli->cl_cache_waiters);
+        init_waitqueue_head(&cli->cl_cache_waitq);
+        INIT_LIST_HEAD(&cli->cl_loi_ready_list);
+        spin_lock_init(&cli->cl_loi_list_lock);
+        cli->cl_brw_in_flight = 0;
+        spin_lock_init(&cli->cl_rpc_concurrency_oh.oh_lock);
+        spin_lock_init(&cli->cl_pages_per_rpc_oh.oh_lock);
+        cli->cl_max_pages_per_rpc = PTL_MD_MAX_IOV;
+        cli->cl_max_rpcs_in_flight = 8;
 
         conn = ptlrpc_uuid_to_connection(&server_uuid);
         if (conn == NULL)