Whamcloud - gitweb
LU-2337 scripts: init script to not use -d with zpool import
[fs/lustre-release.git] / lustre / kernel_patches / patches / jbd-journal-chksum-2.6.18-vanilla.patch
index 3c20f0c..5f26c0b 100644 (file)
@@ -1,7 +1,7 @@
-Index: linux-2.6.18.8/fs/jbd/commit.c
+Index: linux-2.6.18-128.1.6/fs/jbd/commit.c
 ===================================================================
---- linux-2.6.18.8.orig/fs/jbd/commit.c
-+++ linux-2.6.18.8/fs/jbd/commit.c
+--- linux-2.6.18-128.1.6.orig/fs/jbd/commit.c  2009-06-02 23:24:00.000000000 -0600
++++ linux-2.6.18-128.1.6/fs/jbd/commit.c       2009-06-02 23:26:07.000000000 -0600
 @@ -22,6 +22,7 @@
  #include <linux/mm.h>
  #include <linux/pagemap.h>
@@ -10,7 +10,7 @@ Index: linux-2.6.18.8/fs/jbd/commit.c
  
  
  /*
-@@ -95,19 +96,23 @@ static int inverted_lock(journal_t *jour
+@@ -95,19 +96,23 @@
        return 1;
  }
  
@@ -38,7 +38,7 @@ Index: linux-2.6.18.8/fs/jbd/commit.c
        int barrier_done = 0;
  
        if (is_journal_aborted(journal))
-@@ -119,21 +124,34 @@ static int journal_write_commit_record(j
+@@ -119,21 +124,34 @@
  
        bh = jh2bh(descriptor);
  
@@ -82,7 +82,7 @@ Index: linux-2.6.18.8/fs/jbd/commit.c
        /* is it possible for another commit to fail at roughly
         * the same time as this one?  If so, we don't want to
         * trust the barrier flag in the super, but instead want
-@@ -154,12 +173,70 @@ static int journal_write_commit_record(j
+@@ -154,12 +172,70 @@
                clear_buffer_ordered(bh);
                set_buffer_uptodate(bh);
                set_buffer_dirty(bh);
@@ -157,8 +157,8 @@ Index: linux-2.6.18.8/fs/jbd/commit.c
  }
  
  void journal_do_submit_data(struct buffer_head **wbuf, int bufs)
-@@ -273,6 +350,20 @@ write_out_data:
-       journal_do_submit_data(wbuf, bufs);
+@@ -282,6 +358,20 @@
+       return err;
  }
  
 +static inline __u32 jbd_checksum_data(__u32 crc32_sum, struct buffer_head *bh)
@@ -178,7 +178,7 @@ Index: linux-2.6.18.8/fs/jbd/commit.c
  /*
   * journal_commit_transaction
   *
-@@ -296,6 +387,8 @@ void journal_commit_transaction(journal_
+@@ -305,6 +395,8 @@
        int first_tag = 0;
        int tag_flag;
        int i;
@@ -187,8 +187,8 @@ Index: linux-2.6.18.8/fs/jbd/commit.c
  
        /*
         * First job: lock down the current transaction and wait for
-@@ -439,39 +532,14 @@ void journal_commit_transaction(journal_
-       journal_submit_data_buffers(journal, commit_transaction);
+@@ -431,39 +523,14 @@
+       err = journal_submit_data_buffers(journal, commit_transaction);
  
        /*
 -       * Wait for all previously submitted IO to complete.
@@ -223,7 +223,7 @@ Index: linux-2.6.18.8/fs/jbd/commit.c
 -              } else {
 -                      jbd_unlock_bh_state(bh);
 -              }
--              put_bh(bh);
+-              release_data_buffer(bh);
 -              cond_resched_lock(&journal->j_list_lock);
 -      }
 +      if (!JFS_HAS_INCOMPAT_FEATURE(journal,
@@ -233,7 +233,7 @@ Index: linux-2.6.18.8/fs/jbd/commit.c
        spin_unlock(&journal->j_list_lock);
  
        if (err)
-@@ -643,6 +712,16 @@ void journal_commit_transaction(journal_
+@@ -642,6 +709,16 @@
  start_journal_io:
                        for (i = 0; i < bufs; i++) {
                                struct buffer_head *bh = wbuf[i];
@@ -250,7 +250,7 @@ Index: linux-2.6.18.8/fs/jbd/commit.c
                                lock_buffer(bh);
                                clear_buffer_dirty(bh);
                                set_buffer_uptodate(bh);
-@@ -659,6 +738,23 @@ start_journal_io:
+@@ -658,6 +735,23 @@
                }
        }
  
@@ -274,8 +274,8 @@ Index: linux-2.6.18.8/fs/jbd/commit.c
        /* Lo and behold: we have just managed to send a transaction to
             the log.  Before we can commit it, wait for the IO so far to
             complete.  Control buffers being written are on the
-@@ -757,9 +853,15 @@ wait_for_iobuf:
-       }
+@@ -759,9 +853,15 @@
+               journal_abort(journal, err);
  
        jbd_debug(3, "JBD: commit phase 6\n");
 -
@@ -292,74 +292,11 @@ Index: linux-2.6.18.8/fs/jbd/commit.c
 +      err = journal_wait_on_commit_record(cbh);
  
        if (err)
-               __journal_abort_hard(journal);
-Index: linux-2.6.18.8/include/linux/jbd.h
-===================================================================
---- linux-2.6.18.8.orig/include/linux/jbd.h
-+++ linux-2.6.18.8/include/linux/jbd.h
-@@ -148,6 +148,29 @@ typedef struct journal_header_s
-       __be32          h_sequence;
- } journal_header_t;
-+/*
-+ * Checksum types.
-+ */
-+#define JFS_CRC32_CHKSUM   1
-+#define JFS_MD5_CHKSUM     2
-+#define JFS_SHA1_CHKSUM    3
-+
-+#define JFS_CRC32_CHKSUM_SIZE 4
-+
-+#define JFS_CHECKSUM_BYTES (32 / sizeof(u32))
-+/*
-+ * Commit block header for storing transactional checksums:
-+ */
-+struct commit_header
-+{
-+      __be32          h_magic;
-+      __be32          h_blocktype;
-+      __be32          h_sequence;
-+      unsigned char   h_chksum_type;
-+      unsigned char   h_chksum_size;
-+      unsigned char   h_padding[2];
-+      __be32          h_chksum[JFS_CHECKSUM_BYTES];
-+};
- /* 
-  * The block tag: used to describe a single buffer in the journal 
-@@ -234,12 +257,16 @@ typedef struct journal_superblock_s
-       ((j)->j_format_version >= 2 &&                                  \
-        ((j)->j_superblock->s_feature_incompat & cpu_to_be32((mask))))
--#define JFS_FEATURE_INCOMPAT_REVOKE   0x00000001
-+#define JFS_FEATURE_COMPAT_CHECKSUM   0x00000001
-+
-+#define JFS_FEATURE_INCOMPAT_REVOKE           0x00000001
-+#define JFS_FEATURE_INCOMPAT_ASYNC_COMMIT     0x00000004
- /* Features known to this kernel version: */
--#define JFS_KNOWN_COMPAT_FEATURES     0
-+#define JFS_KNOWN_COMPAT_FEATURES     JFS_FEATURE_COMPAT_CHECKSUM
- #define JFS_KNOWN_ROCOMPAT_FEATURES   0
--#define JFS_KNOWN_INCOMPAT_FEATURES   JFS_FEATURE_INCOMPAT_REVOKE
-+#define JFS_KNOWN_INCOMPAT_FEATURES   (JFS_FEATURE_INCOMPAT_REVOKE | \
-+                                      JFS_FEATURE_INCOMPAT_ASYNC_COMMIT)
- #ifdef __KERNEL__
-@@ -1053,6 +1080,8 @@ extern int          journal_check_available_fe
-                  (journal_t *, unsigned long, unsigned long, unsigned long);
- extern int       journal_set_features 
-                  (journal_t *, unsigned long, unsigned long, unsigned long);
-+extern int       journal_clear_features
-+                 (journal_t *, unsigned long, unsigned long, unsigned long);
- extern int       journal_create     (journal_t *);
- extern int       journal_load       (journal_t *journal);
- extern void      journal_destroy    (journal_t *);
-Index: linux-2.6.18.8/fs/jbd/recovery.c
+               journal_abort(journal, err);
+Index: linux-2.6.18-128.1.6/fs/jbd/recovery.c
 ===================================================================
---- linux-2.6.18.8.orig/fs/jbd/recovery.c
-+++ linux-2.6.18.8/fs/jbd/recovery.c
+--- linux-2.6.18-128.1.6.orig/fs/jbd/recovery.c        2009-04-14 21:05:39.000000000 -0600
++++ linux-2.6.18-128.1.6/fs/jbd/recovery.c     2009-06-02 23:26:07.000000000 -0600
 @@ -21,6 +21,7 @@
  #include <linux/jbd.h>
  #include <linux/errno.h>
@@ -368,7 +305,7 @@ Index: linux-2.6.18.8/fs/jbd/recovery.c
  #endif
  
  /*
-@@ -307,6 +308,38 @@ int journal_skip_recovery(journal_t *jou
+@@ -310,6 +311,38 @@
        return err;
  }
  
@@ -407,7 +344,7 @@ Index: linux-2.6.18.8/fs/jbd/recovery.c
  static int do_one_pass(journal_t *journal,
                        struct recovery_info *info, enum passtype pass)
  {
-@@ -318,6 +351,7 @@ static int do_one_pass(journal_t *journa
+@@ -321,6 +354,7 @@
        struct buffer_head *    bh;
        unsigned int            sequence;
        int                     blocktype;
@@ -415,7 +352,7 @@ Index: linux-2.6.18.8/fs/jbd/recovery.c
  
        /* Precompute the maximum metadata descriptors in a descriptor block */
        int                     MAX_BLOCKS_PER_DESC;
-@@ -409,9 +443,24 @@ static int do_one_pass(journal_t *journa
+@@ -412,9 +446,24 @@
                switch(blocktype) {
                case JFS_DESCRIPTOR_BLOCK:
                        /* If it is a valid descriptor block, replay it
@@ -442,7 +379,7 @@ Index: linux-2.6.18.8/fs/jbd/recovery.c
                                next_log_block +=
                                        count_tags(bh, journal->j_blocksize);
                                wrap(journal, next_log_block);
-@@ -506,9 +555,97 @@ static int do_one_pass(journal_t *journa
+@@ -509,9 +558,97 @@
                        continue;
  
                case JFS_COMMIT_BLOCK:
@@ -542,7 +479,7 @@ Index: linux-2.6.18.8/fs/jbd/recovery.c
                        brelse(bh);
                        next_commit_ID++;
                        continue;
-@@ -544,9 +681,10 @@ static int do_one_pass(journal_t *journa
+@@ -547,9 +684,10 @@
         * transaction marks the end of the valid log.
         */
  
@@ -556,11 +493,11 @@ Index: linux-2.6.18.8/fs/jbd/recovery.c
                /* It's really bad news if different passes end up at
                 * different places (but possible due to IO errors). */
                if (info->end_transaction != next_commit_ID) {
-Index: linux-2.6.18.8/fs/jbd/journal.c
+Index: linux-2.6.18-128.1.6/fs/jbd/journal.c
 ===================================================================
---- linux-2.6.18.8.orig/fs/jbd/journal.c
-+++ linux-2.6.18.8/fs/jbd/journal.c
-@@ -67,6 +67,7 @@ EXPORT_SYMBOL(journal_update_format);
+--- linux-2.6.18-128.1.6.orig/fs/jbd/journal.c 2009-06-02 23:24:00.000000000 -0600
++++ linux-2.6.18-128.1.6/fs/jbd/journal.c      2009-06-02 23:26:07.000000000 -0600
+@@ -67,6 +67,7 @@
  EXPORT_SYMBOL(journal_check_used_features);
  EXPORT_SYMBOL(journal_check_available_features);
  EXPORT_SYMBOL(journal_set_features);
@@ -568,7 +505,7 @@ Index: linux-2.6.18.8/fs/jbd/journal.c
  EXPORT_SYMBOL(journal_create);
  EXPORT_SYMBOL(journal_load);
  EXPORT_SYMBOL(journal_destroy);
-@@ -1573,6 +1574,33 @@ int journal_set_features (journal_t *jou
+@@ -1583,6 +1584,33 @@
        return 1;
  }
  
@@ -602,11 +539,11 @@ Index: linux-2.6.18.8/fs/jbd/journal.c
  
  /**
   * int journal_update_format () - Update on-disk journal structure.
-Index: linux-2.6.18.8/fs/Kconfig
+Index: linux-2.6.18-128.1.6/fs/Kconfig
 ===================================================================
---- linux-2.6.18.8.orig/fs/Kconfig
-+++ linux-2.6.18.8/fs/Kconfig
-@@ -140,6 +140,7 @@ config EXT3_FS_SECURITY
+--- linux-2.6.18-128.1.6.orig/fs/Kconfig       2009-04-14 21:05:39.000000000 -0600
++++ linux-2.6.18-128.1.6/fs/Kconfig    2009-06-02 23:26:07.000000000 -0600
+@@ -206,6 +206,7 @@
  
  config JBD
        tristate
@@ -614,11 +551,74 @@ Index: linux-2.6.18.8/fs/Kconfig
        help
          This is a generic journaling layer for block devices.  It is
          currently used by the ext3 and OCFS2 file systems, but it could
-Index: linux-2.6.18.8/Documentation/filesystems/ext3.txt
+Index: linux-2.6.18-128.1.6/include/linux/jbd.h
+===================================================================
+--- linux-2.6.18-128.1.6.orig/include/linux/jbd.h      2009-06-02 23:24:00.000000000 -0600
++++ linux-2.6.18-128.1.6/include/linux/jbd.h   2009-06-02 23:26:07.000000000 -0600
+@@ -148,6 +148,29 @@
+       __be32          h_sequence;
+ } journal_header_t;
++/*
++ * Checksum types.
++ */
++#define JFS_CRC32_CHKSUM   1
++#define JFS_MD5_CHKSUM     2
++#define JFS_SHA1_CHKSUM    3
++
++#define JFS_CRC32_CHKSUM_SIZE 4
++
++#define JFS_CHECKSUM_BYTES (32 / sizeof(u32))
++/*
++ * Commit block header for storing transactional checksums:
++ */
++struct commit_header
++{
++      __be32          h_magic;
++      __be32          h_blocktype;
++      __be32          h_sequence;
++      unsigned char   h_chksum_type;
++      unsigned char   h_chksum_size;
++      unsigned char   h_padding[2];
++      __be32          h_chksum[JFS_CHECKSUM_BYTES];
++};
+ /* 
+  * The block tag: used to describe a single buffer in the journal 
+@@ -234,12 +257,16 @@
+       ((j)->j_format_version >= 2 &&                                  \
+        ((j)->j_superblock->s_feature_incompat & cpu_to_be32((mask))))
+-#define JFS_FEATURE_INCOMPAT_REVOKE   0x00000001
++#define JFS_FEATURE_COMPAT_CHECKSUM   0x00000001
++
++#define JFS_FEATURE_INCOMPAT_REVOKE           0x00000001
++#define JFS_FEATURE_INCOMPAT_ASYNC_COMMIT     0x00000004
+ /* Features known to this kernel version: */
+-#define JFS_KNOWN_COMPAT_FEATURES     0
++#define JFS_KNOWN_COMPAT_FEATURES     JFS_FEATURE_COMPAT_CHECKSUM
+ #define JFS_KNOWN_ROCOMPAT_FEATURES   0
+-#define JFS_KNOWN_INCOMPAT_FEATURES   JFS_FEATURE_INCOMPAT_REVOKE
++#define JFS_KNOWN_INCOMPAT_FEATURES   (JFS_FEATURE_INCOMPAT_REVOKE | \
++                                      JFS_FEATURE_INCOMPAT_ASYNC_COMMIT)
+ #ifdef __KERNEL__
+@@ -1053,6 +1080,8 @@
+                  (journal_t *, unsigned long, unsigned long, unsigned long);
+ extern int       journal_set_features 
+                  (journal_t *, unsigned long, unsigned long, unsigned long);
++extern int       journal_clear_features
++                 (journal_t *, unsigned long, unsigned long, unsigned long);
+ extern int       journal_create     (journal_t *);
+ extern int       journal_load       (journal_t *journal);
+ #ifndef __GENKSYMS__
+Index: linux-2.6.18-128.1.6/Documentation/filesystems/ext3.txt
 ===================================================================
---- linux-2.6.18.8.orig/Documentation/filesystems/ext3.txt
-+++ linux-2.6.18.8/Documentation/filesystems/ext3.txt
-@@ -14,6 +14,16 @@ Options
+--- linux-2.6.18-128.1.6.orig/Documentation/filesystems/ext3.txt       2006-09-19 21:42:06.000000000 -0600
++++ linux-2.6.18-128.1.6/Documentation/filesystems/ext3.txt    2009-06-02 23:26:07.000000000 -0600
+@@ -14,6 +14,16 @@
  When mounting an ext3 filesystem, the following option are accepted:
  (*) == default