]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - fs/jbd/commit.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
[mv-sheeva.git] / fs / jbd / commit.c
index 618e21c0b7a324b9b5b1853c982b2a9cbbf42fe2..2c90e3ef625f35ae0bfdfa74270273c9d35a1695 100644 (file)
@@ -308,7 +308,7 @@ void journal_commit_transaction(journal_t *journal)
        int bufs;
        int flags;
        int err;
-       unsigned long blocknr;
+       unsigned int blocknr;
        ktime_t start_time;
        u64 commit_time;
        char *tagp = NULL;
@@ -862,12 +862,12 @@ restart_loop:
                /* A buffer which has been freed while still being
                 * journaled by a previous transaction may end up still
                 * being dirty here, but we want to avoid writing back
-                * that buffer in the future now that the last use has
-                * been committed.  That's not only a performance gain,
-                * it also stops aliasing problems if the buffer is left
-                * behind for writeback and gets reallocated for another
+                * that buffer in the future after the "add to orphan"
+                * operation been committed,  That's not only a performance
+                * gain, it also stops aliasing problems if the buffer is
+                * left behind for writeback and gets reallocated for another
                 * use in a different page. */
-               if (buffer_freed(bh)) {
+               if (buffer_freed(bh) && !jh->b_next_transaction) {
                        clear_buffer_freed(bh);
                        clear_buffer_jbddirty(bh);
                }