]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/jbd/commit.c
Merge branch 'release' of ssh://master.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
[linux-2.6-omap-h63xx.git] / fs / jbd / commit.c
index 32a8caf0c41ebf44e170feb78cf4c2ae19ba0eb5..a003d50edcdbdc1fe45a7627e83191cd55df378c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * linux/fs/commit.c
+ * linux/fs/jbd/commit.c
  *
  * Written by Stephen C. Tweedie <sct@redhat.com>, 1998
  *
@@ -20,7 +20,6 @@
 #include <linux/slab.h>
 #include <linux/mm.h>
 #include <linux/pagemap.h>
-#include <linux/smp_lock.h>
 
 /*
  * Default IO end handler for temporary BJ_IO buffer_heads.
@@ -248,8 +247,12 @@ write_out_data:
                                bufs = 0;
                                goto write_out_data;
                        }
-               }
-               else {
+               } else if (!locked && buffer_locked(bh)) {
+                       __journal_file_buffer(jh, commit_transaction,
+                                               BJ_Locked);
+                       jbd_unlock_bh_state(bh);
+                       put_bh(bh);
+               } else {
                        BUFFER_TRACE(bh, "writeout complete: unfile");
                        __journal_unfile_buffer(jh);
                        jbd_unlock_bh_state(bh);
@@ -884,7 +887,8 @@ restart_loop:
        journal->j_committing_transaction = NULL;
        spin_unlock(&journal->j_state_lock);
 
-       if (commit_transaction->t_checkpoint_list == NULL) {
+       if (commit_transaction->t_checkpoint_list == NULL &&
+           commit_transaction->t_checkpoint_io_list == NULL) {
                __journal_drop_transaction(journal, commit_transaction);
        } else {
                if (journal->j_checkpoint_transactions == NULL) {