-Index: linux-2.6.18-128.1.6/fs/jbd/commit.c
+Index: linux-2.6.18-164.6.1/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
+--- linux-2.6.18-164.6.1.orig/fs/jbd/commit.c
++++ linux-2.6.18-164.6.1/fs/jbd/commit.c
@@ -22,6 +22,7 @@
#include <linux/mm.h>
#include <linux/pagemap.h>
/*
-@@ -95,19 +96,23 @@
+@@ -108,19 +109,23 @@ static int inverted_lock(journal_t *jour
return 1;
}
int barrier_done = 0;
if (is_journal_aborted(journal))
-@@ -119,21 +124,34 @@
+@@ -132,21 +137,34 @@ static int journal_write_commit_record(j
bh = jh2bh(descriptor);
/* 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 +172,70 @@
+@@ -164,15 +182,76 @@ static int journal_write_commit_record(j
+ spin_unlock(&journal->j_state_lock);
+
+ /* And try again, without the barrier */
++ lock_buffer(bh);
clear_buffer_ordered(bh);
set_buffer_uptodate(bh);
set_buffer_dirty(bh);
+ *cbh = bh;
+ return ret;
+}
-+
+
+- return (ret == -EIO);
+/*
+ * This function along with journal_submit_commit_record
+ * allows to write the commit record asynchronously.
+{
+ int ret = 0;
+ struct journal_head *jh;
-
-- return (ret == -EIO);
++
+ while (commit_transaction->t_locked_list) {
+ struct buffer_head *bh;
+
+ if (buffer_locked(bh)) {
+ spin_unlock(&journal->j_list_lock);
+ wait_on_buffer(bh);
-+ if (unlikely(!buffer_uptodate(bh)))
-+ ret = -EIO;
+ spin_lock(&journal->j_list_lock);
+ }
++ if (unlikely(!buffer_uptodate(bh)))
++ ret = -EIO;
+ if (!inverted_lock(journal, bh)) {
+ put_bh(bh);
+ spin_lock(&journal->j_list_lock);
+ continue;
+ }
-+ if (buffer_jbd(bh) && jh->b_jlist == BJ_Locked) {
++ if (buffer_jbd(bh) && bh2jh(bh) == jh &&
++ jh->b_transaction == commit_transaction &&
++ jh->b_jlist == BJ_Locked) {
+ __journal_unfile_buffer(jh);
+ jbd_unlock_bh_state(bh);
+ journal_remove_journal_head(bh);
+ } else {
+ jbd_unlock_bh_state(bh);
+ }
-+ put_bh(bh);
++ release_data_buffer(bh);
+ cond_resched_lock(&journal->j_list_lock);
+ }
+ return ret;
}
void journal_do_submit_data(struct buffer_head **wbuf, int bufs)
-@@ -282,6 +358,20 @@
+@@ -295,6 +372,20 @@ write_out_data:
return err;
}
/*
* journal_commit_transaction
*
-@@ -305,6 +395,8 @@
+@@ -318,6 +409,8 @@ void journal_commit_transaction(journal_
int first_tag = 0;
int tag_flag;
int i;
/*
* First job: lock down the current transaction and wait for
-@@ -431,39 +523,14 @@
+@@ -446,41 +537,14 @@ void journal_commit_transaction(journal_
err = journal_submit_data_buffers(journal, commit_transaction);
/*
- spin_lock(&journal->j_list_lock);
- continue;
- }
-- if (buffer_jbd(bh) && jh->b_jlist == BJ_Locked) {
+- if (buffer_jbd(bh) && bh2jh(bh) == jh &&
+- jh->b_transaction == commit_transaction &&
+- jh->b_jlist == BJ_Locked) {
- __journal_unfile_buffer(jh);
- jbd_unlock_bh_state(bh);
- journal_remove_journal_head(bh);
spin_unlock(&journal->j_list_lock);
if (err)
-@@ -642,6 +709,16 @@
+@@ -653,6 +721,16 @@ void journal_commit_transaction(journal_
start_journal_io:
for (i = 0; i < bufs; i++) {
struct buffer_head *bh = wbuf[i];
lock_buffer(bh);
clear_buffer_dirty(bh);
set_buffer_uptodate(bh);
-@@ -658,6 +735,23 @@
+@@ -669,6 +747,23 @@ start_journal_io:
}
}
/* 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
-@@ -759,9 +853,15 @@
+@@ -770,9 +865,15 @@ wait_for_iobuf:
journal_abort(journal, err);
jbd_debug(3, "JBD: commit phase 6\n");
if (err)
journal_abort(journal, err);
-Index: linux-2.6.18-128.1.6/fs/jbd/recovery.c
+Index: linux-2.6.18-164.6.1/include/linux/jbd.h
===================================================================
---- 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
+--- linux-2.6.18-164.6.1.orig/include/linux/jbd.h
++++ linux-2.6.18-164.6.1/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);
+ #ifndef __GENKSYMS__
+Index: linux-2.6.18-164.6.1/fs/jbd/recovery.c
+===================================================================
+--- linux-2.6.18-164.6.1.orig/fs/jbd/recovery.c
++++ linux-2.6.18-164.6.1/fs/jbd/recovery.c
@@ -21,6 +21,7 @@
#include <linux/jbd.h>
#include <linux/errno.h>
#endif
/*
-@@ -310,6 +311,38 @@
+@@ -310,6 +311,38 @@ int journal_skip_recovery(journal_t *jou
return err;
}
static int do_one_pass(journal_t *journal,
struct recovery_info *info, enum passtype pass)
{
-@@ -321,6 +354,7 @@
+@@ -321,6 +354,7 @@ static int do_one_pass(journal_t *journa
struct buffer_head * bh;
unsigned int sequence;
int blocktype;
/* Precompute the maximum metadata descriptors in a descriptor block */
int MAX_BLOCKS_PER_DESC;
-@@ -412,9 +446,24 @@
+@@ -412,9 +446,24 @@ static int do_one_pass(journal_t *journa
switch(blocktype) {
case JFS_DESCRIPTOR_BLOCK:
/* If it is a valid descriptor block, replay it
next_log_block +=
count_tags(bh, journal->j_blocksize);
wrap(journal, next_log_block);
-@@ -509,9 +558,97 @@
+@@ -509,9 +558,97 @@ static int do_one_pass(journal_t *journa
continue;
case JFS_COMMIT_BLOCK:
brelse(bh);
next_commit_ID++;
continue;
-@@ -547,9 +684,10 @@
+@@ -547,9 +684,10 @@ static int do_one_pass(journal_t *journa
* transaction marks the end of the valid log.
*/
/* 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-128.1.6/fs/jbd/journal.c
+Index: linux-2.6.18-164.6.1/fs/jbd/journal.c
===================================================================
---- 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 @@
+--- linux-2.6.18-164.6.1.orig/fs/jbd/journal.c
++++ linux-2.6.18-164.6.1/fs/jbd/journal.c
+@@ -67,6 +67,7 @@ EXPORT_SYMBOL(journal_update_format);
EXPORT_SYMBOL(journal_check_used_features);
EXPORT_SYMBOL(journal_check_available_features);
EXPORT_SYMBOL(journal_set_features);
EXPORT_SYMBOL(journal_create);
EXPORT_SYMBOL(journal_load);
EXPORT_SYMBOL(journal_destroy);
-@@ -1583,6 +1584,33 @@
+@@ -1583,6 +1584,33 @@ int journal_set_features (journal_t *jou
return 1;
}
/**
* int journal_update_format () - Update on-disk journal structure.
-Index: linux-2.6.18-128.1.6/fs/Kconfig
+Index: linux-2.6.18-164.6.1/fs/Kconfig
===================================================================
---- 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 @@
+--- linux-2.6.18-164.6.1.orig/fs/Kconfig
++++ linux-2.6.18-164.6.1/fs/Kconfig
+@@ -142,6 +142,7 @@ source "fs/ext4/Kconfig"
config JBD
tristate
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-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
+Index: linux-2.6.18-164.6.1/Documentation/filesystems/ext3.txt
===================================================================
---- 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 @@
+--- linux-2.6.18-164.6.1.orig/Documentation/filesystems/ext3.txt
++++ linux-2.6.18-164.6.1/Documentation/filesystems/ext3.txt
+@@ -14,6 +14,16 @@ Options
When mounting an ext3 filesystem, the following option are accepted:
(*) == default
-Index: linux-2.6.18-128.1.6/drivers/md/raid5.c
+Index: linux-2.6.18-128.1.14/drivers/md/raid5.c
===================================================================
---- linux-2.6.18-128.1.6.orig/drivers/md/raid5.c 2009-06-02 23:24:52.000000000 -0600
-+++ linux-2.6.18-128.1.6/drivers/md/raid5.c 2009-06-02 23:24:55.000000000 -0600
+--- linux-2.6.18-128.1.14.orig/drivers/md/raid5.c 2009-06-19 12:34:46.000000000 -0600
++++ linux-2.6.18-128.1.14/drivers/md/raid5.c 2009-06-19 12:34:50.000000000 -0600
@@ -633,6 +633,9 @@
clear_buffer_uptodate(bh);
}
clear_bit(R5_LOCKED, &sh->dev[i].flags);
set_bit(STRIPE_HANDLE, &sh->state);
}
-@@ -3451,6 +3595,9 @@
+@@ -3449,6 +3593,9 @@
mddev->queue->max_phys_segments = conf->chunk_size * conf->previous_raid_disks >> PAGE_SHIFT;
mddev->queue->max_hw_segments = conf->chunk_size * conf->previous_raid_disks >> PAGE_SHIFT;;
return 0;
abort:
if (conf) {
-@@ -3537,9 +3684,11 @@
+@@ -3535,9 +3682,11 @@
atomic_read(&conf->handled_in_raid5d),
atomic_read(&conf->out_of_stripes),
atomic_read(&conf->handle_called));
seq_printf (seq, "\n\t\t%u delayed, %u bit delayed, %u active, queues: %u in, %u out\n",
atomic_read(&conf->delayed), atomic_read(&conf->bit_delayed),
atomic_read(&conf->active_stripes),
-Index: linux-2.6.18-128.1.6/include/linux/backing-dev.h
+Index: linux-2.6.18-128.1.14/include/linux/backing-dev.h
===================================================================
---- linux-2.6.18-128.1.6.orig/include/linux/backing-dev.h 2006-09-19 21:42:06.000000000 -0600
-+++ linux-2.6.18-128.1.6/include/linux/backing-dev.h 2009-06-02 23:24:55.000000000 -0600
+--- linux-2.6.18-128.1.14.orig/include/linux/backing-dev.h 2009-06-19 12:33:11.000000000 -0600
++++ linux-2.6.18-128.1.14/include/linux/backing-dev.h 2009-06-19 12:34:50.000000000 -0600
@@ -48,6 +48,7 @@
#define BDI_CAP_THROTTLE_DIRTY 0x00010000 /* throttle in balance_dirty_pages when BDI is congested */
#define BDI_CAP_VMFLAGS \
+
#endif /* _LINUX_BACKING_DEV_H */
-Index: linux-2.6.18-128.1.6/include/linux/page-flags.h
+Index: linux-2.6.18-128.1.14/include/linux/page-flags.h
===================================================================
---- linux-2.6.18-128.1.6.orig/include/linux/page-flags.h 2009-04-14 21:05:24.000000000 -0600
-+++ linux-2.6.18-128.1.6/include/linux/page-flags.h 2009-06-02 23:24:55.000000000 -0600
-@@ -86,6 +86,7 @@
+--- linux-2.6.18-128.1.14.orig/include/linux/page-flags.h 2009-06-19 12:33:11.000000000 -0600
++++ linux-2.6.18-128.1.14/include/linux/page-flags.h 2009-06-19 12:34:50.000000000 -0600
+@@ -87,6 +87,7 @@
#define PG_reclaim 17 /* To be reclaimed asap */
#define PG_nosave_free 18 /* Free, should not be written */
#define PG_buddy 19 /* Page is free, on buddy lists */
#define PG_xpmem 27 /* Testing for xpmem. */
/* PG_owner_priv_1 users should have descriptive aliases */
-@@ -283,6 +284,14 @@
+@@ -288,6 +289,14 @@
struct page; /* forward declaration */
int test_clear_page_dirty(struct page *page);
int test_clear_page_writeback(struct page *page);
int test_set_page_writeback(struct page *page);
-Index: linux-2.6.18-128.1.6/include/linux/raid/raid5.h
+Index: linux-2.6.18-128.1.14/include/linux/raid/raid5.h
===================================================================
---- linux-2.6.18-128.1.6.orig/include/linux/raid/raid5.h 2009-06-02 23:24:50.000000000 -0600
-+++ linux-2.6.18-128.1.6/include/linux/raid/raid5.h 2009-06-02 23:24:55.000000000 -0600
+--- linux-2.6.18-128.1.14.orig/include/linux/raid/raid5.h 2009-06-19 12:34:42.000000000 -0600
++++ linux-2.6.18-128.1.14/include/linux/raid/raid5.h 2009-06-19 12:34:50.000000000 -0600
@@ -156,8 +156,9 @@
#define R5_Overlap 7 /* There is a pending overlapping request on this block */
#define R5_ReadError 8 /* seen a read error here recently */
/*
* Write method
*/
-Index: linux-2.6.18-128.1.6/mm/filemap.c
+Index: linux-2.6.18-128.1.14/mm/filemap.c
===================================================================
---- linux-2.6.18-128.1.6.orig/mm/filemap.c 2009-04-14 21:05:46.000000000 -0600
-+++ linux-2.6.18-128.1.6/mm/filemap.c 2009-06-02 23:24:55.000000000 -0600
+--- linux-2.6.18-128.1.14.orig/mm/filemap.c 2009-06-19 12:33:11.000000000 -0600
++++ linux-2.6.18-128.1.14/mm/filemap.c 2009-06-19 12:34:50.000000000 -0600
@@ -30,6 +30,7 @@
#include <linux/security.h>
#include <linux/syscalls.h>
#include <trace/mm.h>
#include "internal.h"
@@ -567,11 +568,55 @@
- if (!test_clear_page_writeback(page))
- BUG();
- }
+ if (!test_clear_page_writeback(page))
+ BUG();
+
+ clear_page_constant(page);
smp_mb__after_clear_bit();
wake_up_page(page, PG_writeback);