Whamcloud - gitweb
- ext3_stop_delete_thread() has to wait for nullified s_delete_list,
[fs/lustre-release.git] / lustre / kernel_patches / patches / ext3-delete_thread-2.4.21-chaos.patch
index b73ebf5..2fc365d 100644 (file)
@@ -7,9 +7,9 @@
 
 Index: linux-2.4.21-chaos/fs/ext3/super.c
 ===================================================================
---- linux-2.4.21-chaos.orig/fs/ext3/super.c    2003-12-12 16:18:41.000000000 +0300
-+++ linux-2.4.21-chaos/fs/ext3/super.c 2003-12-12 16:18:43.000000000 +0300
-@@ -425,6 +425,220 @@
+--- linux-2.4.21-chaos.orig/fs/ext3/super.c    2004-01-12 19:20:07.000000000 +0300
++++ linux-2.4.21-chaos/fs/ext3/super.c 2004-01-13 17:25:49.000000000 +0300
+@@ -425,6 +425,221 @@
        }
  }
  
@@ -123,7 +123,8 @@ Index: linux-2.4.21-chaos/fs/ext3/super.c
 +
 +      clear_opt(sbi->s_mount_opt, ASYNCDEL);
 +      wake_up(&sbi->s_delete_thread_queue);
-+      wait_event(sbi->s_delete_waiter_queue, list_empty(&sbi->s_delete_list));
++      wait_event(sbi->s_delete_waiter_queue,
++                      sbi->s_delete_list.next == 0 && sbi->s_delete_inodes == 0);
 +}
 +
 +/* Instead of playing games with the inode flags, destruction, etc we just
@@ -230,15 +231,15 @@ Index: linux-2.4.21-chaos/fs/ext3/super.c
  void ext3_put_super (struct super_block * sb)
  {
        struct ext3_sb_info *sbi = EXT3_SB(sb);
-@@ -432,6 +646,7 @@
+@@ -432,6 +647,7 @@
        kdev_t j_dev = sbi->s_journal->j_dev;
        int i;
  
-+      ext3_stop_delete_thread(sbi);
++      J_ASSERT(sbi->s_delete_inodes == 0);
        ext3_xattr_put_super(sb);
        journal_destroy(sbi->s_journal);
        if (!(sb->s_flags & MS_RDONLY)) {
-@@ -501,7 +716,11 @@
+@@ -501,7 +717,11 @@
        write_inode:    ext3_write_inode,       /* BKL not held.  Don't need */
        dirty_inode:    ext3_dirty_inode,       /* BKL not held.  We take it */
        put_inode:      ext3_put_inode,         /* BKL not held.  Don't need */
@@ -250,7 +251,7 @@ Index: linux-2.4.21-chaos/fs/ext3/super.c
        put_super:      ext3_put_super,         /* BKL held */
        write_super:    ext3_write_super,       /* BKL held */
        sync_fs:        ext3_sync_fs,
-@@ -579,6 +798,13 @@
+@@ -579,6 +799,13 @@
                        *mount_flags &= ~MS_POSIXACL;
                else
  #endif
@@ -264,7 +265,7 @@ Index: linux-2.4.21-chaos/fs/ext3/super.c
                if (!strcmp (this_char, "bsddf"))
                        clear_opt (*mount_options, MINIX_DF);
                else if (!strcmp (this_char, "nouid32")) {
-@@ -1283,6 +1509,7 @@
+@@ -1283,6 +1510,7 @@
        }
  
        ext3_setup_super (sb, es, sb->s_flags & MS_RDONLY);
@@ -272,7 +273,21 @@ Index: linux-2.4.21-chaos/fs/ext3/super.c
        /*
         * akpm: core read_super() calls in here with the superblock locked.
         * That deadlocks, because orphan cleanup needs to lock the superblock
-@@ -1746,6 +1973,9 @@
+@@ -1676,7 +1904,12 @@
+ static int ext3_sync_fs(struct super_block *sb)
+ {
+       tid_t target;
+-      
++
++      if (atomic_read(&sb->s_active) == 0) {
++              /* fs is being umounted: time to stop delete thread */
++              ext3_stop_delete_thread(EXT3_SB(sb));
++      }
++
+       sb->s_dirt = 0;
+       target = log_start_commit(EXT3_SB(sb)->s_journal, NULL);
+       log_wait_commit(EXT3_SB(sb)->s_journal, target);
+@@ -1746,6 +1979,9 @@
        if (!parse_options(data, &tmp, sbi, &mount_flags, &tmp, 1))
                return -EINVAL;
  
@@ -284,8 +299,8 @@ Index: linux-2.4.21-chaos/fs/ext3/super.c
  
 Index: linux-2.4.21-chaos/fs/ext3/inode.c
 ===================================================================
---- linux-2.4.21-chaos.orig/fs/ext3/inode.c    2003-12-12 16:18:40.000000000 +0300
-+++ linux-2.4.21-chaos/fs/ext3/inode.c 2003-12-12 16:18:43.000000000 +0300
+--- linux-2.4.21-chaos.orig/fs/ext3/inode.c    2004-01-12 19:20:06.000000000 +0300
++++ linux-2.4.21-chaos/fs/ext3/inode.c 2004-01-12 19:20:07.000000000 +0300
 @@ -2179,6 +2179,118 @@
        return;         /* AKPM: return what? */
  }
@@ -407,8 +422,8 @@ Index: linux-2.4.21-chaos/fs/ext3/inode.c
   * inode's underlying buffer_head on success. 
 Index: linux-2.4.21-chaos/fs/ext3/file.c
 ===================================================================
---- linux-2.4.21-chaos.orig/fs/ext3/file.c     2003-12-12 16:18:27.000000000 +0300
-+++ linux-2.4.21-chaos/fs/ext3/file.c  2003-12-12 16:18:43.000000000 +0300
+--- linux-2.4.21-chaos.orig/fs/ext3/file.c     2004-01-12 19:20:06.000000000 +0300
++++ linux-2.4.21-chaos/fs/ext3/file.c  2004-01-12 19:20:07.000000000 +0300
 @@ -132,7 +132,11 @@
  };
  
@@ -423,8 +438,8 @@ Index: linux-2.4.21-chaos/fs/ext3/file.c
        getxattr:       ext3_getxattr,          /* BKL held */
 Index: linux-2.4.21-chaos/include/linux/ext3_fs.h
 ===================================================================
---- linux-2.4.21-chaos.orig/include/linux/ext3_fs.h    2003-12-12 16:18:40.000000000 +0300
-+++ linux-2.4.21-chaos/include/linux/ext3_fs.h 2003-12-12 16:18:43.000000000 +0300
+--- linux-2.4.21-chaos.orig/include/linux/ext3_fs.h    2004-01-12 19:20:06.000000000 +0300
++++ linux-2.4.21-chaos/include/linux/ext3_fs.h 2004-01-12 19:20:07.000000000 +0300
 @@ -195,6 +195,7 @@
   */
  #define EXT3_STATE_JDATA              0x00000001 /* journaled data exists */
@@ -453,8 +468,8 @@ Index: linux-2.4.21-chaos/include/linux/ext3_fs.h
  extern int ext3_ioctl (struct inode *, struct file *, unsigned int,
 Index: linux-2.4.21-chaos/include/linux/ext3_fs_sb.h
 ===================================================================
---- linux-2.4.21-chaos.orig/include/linux/ext3_fs_sb.h 2003-12-12 16:18:41.000000000 +0300
-+++ linux-2.4.21-chaos/include/linux/ext3_fs_sb.h      2003-12-12 16:18:43.000000000 +0300
+--- linux-2.4.21-chaos.orig/include/linux/ext3_fs_sb.h 2004-01-12 19:20:07.000000000 +0300
++++ linux-2.4.21-chaos/include/linux/ext3_fs_sb.h      2004-01-12 20:53:51.000000000 +0300
 @@ -29,6 +29,8 @@
  
  #define EXT3_MAX_GROUP_LOADED 32