Whamcloud - gitweb
b=19625
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / ext3-mmp-2.6-rhel4.patch
index 080bff0..6a5d68a 100644 (file)
@@ -20,7 +20,7 @@ Index: linux-2.6.9-67.0.22/fs/ext3/super.c
        if (sbi->s_dev_proc) {
                remove_proc_entry(sbi->s_dev_proc->name, proc_root_ext3);
                sbi->s_dev_proc = NULL;
-@@ -1430,6 +1434,314 @@ static unsigned long descriptor_loc(stru
+@@ -1441,6 +1445,330 @@ static unsigned long descriptor_loc(stru
        return (first_data_block + has_super + (bg * sbi->s_blocks_per_group));
  }
  
@@ -54,9 +54,25 @@ Index: linux-2.6.9-67.0.22/fs/ext3/super.c
 +      if (*bh)
 +              clear_buffer_uptodate(*bh);
 +
++#if 0
 +      brelse(*bh);
 +
 +      *bh = sb_bread(sb, mmp_block);
++#else
++      if (!*bh)
++              *bh = sb_getblk(sb, mmp_block);
++      if (*bh) {
++              get_bh(*bh);
++              lock_buffer(*bh);
++              (*bh)->b_end_io = end_buffer_read_sync;
++              submit_bh(READ_SYNC, *bh);
++              wait_on_buffer(*bh);
++              if (!buffer_uptodate(*bh)) {
++                      brelse(*bh);
++                      *bh = NULL;
++              }
++      }
++#endif
 +      if (!*bh) {
 +              ext3_warning(sb, __FUNCTION__,
 +                           "Error while reading MMP block %lu", mmp_block);
@@ -335,19 +351,28 @@ Index: linux-2.6.9-67.0.22/fs/ext3/super.c
  
  static int ext3_fill_super (struct super_block *sb, void *data, int silent)
  {
-@@ -1754,6 +2066,11 @@ static int ext3_fill_super (struct super
+@@ -1765,6 +2093,11 @@ static int ext3_fill_super (struct super
                          EXT3_HAS_INCOMPAT_FEATURE(sb,
                                    EXT3_FEATURE_INCOMPAT_RECOVER));
  
 +      if (EXT3_HAS_INCOMPAT_FEATURE(sb, EXT3_FEATURE_INCOMPAT_MMP) &&
 +          !(sb->s_flags & MS_RDONLY))
 +              if (ext3_multi_mount_protect(sb, le64_to_cpu(es->s_mmp_block)))
-+                      goto failed_mount3;
++                      goto failed_mount2;
 +
        /*
         * The first inode we look at is the journal inode.  Don't try
         * root first: it may be modified in the journal!
-@@ -2404,6 +2721,11 @@ int ext3_remount (struct super_block * s
+@@ -1890,6 +2223,8 @@ static int ext3_fill_super (struct super
+ failed_mount3:
+       journal_destroy(sbi->s_journal);
+ failed_mount2:
++      if (sbi->s_mmp_tsk)
++              kthread_stop(sbi->s_mmp_tsk);
+       for (i = 0; i < db_count; i++)
+               brelse(sbi->s_group_desc[i]);
+       kfree(sbi->s_group_desc);
+@@ -2415,6 +2750,11 @@ int ext3_remount (struct super_block * s
                                return ret;
                        if (!ext3_setup_super (sb, es, 0))
                                sb->s_flags &= ~MS_RDONLY;