--- linux-2.4-ext3merge/fs/jbd/transaction.c.=K0019=.orig 2003-03-14 18:20:37.000000000 +0000 +++ linux-2.4-ext3merge/fs/jbd/transaction.c 2003-03-14 18:21:06.000000000 +0000 @@ -1479,8 +1479,13 @@ int journal_stop(handle_t *handle) * Special case: JFS_SYNC synchronous updates require us * to wait for the commit to complete. */ - if (handle->h_sync && !(current->flags & PF_MEMALLOC)) + if (handle->h_sync && !(current->flags & PF_MEMALLOC)) { log_wait_commit(journal, tid); + if (handle->h_flush) { + while (tid_geq(journal->j_tail_sequence, tid)) + log_do_checkpoint(journal, 1); + } + } } kfree(handle); return err; --- linux-2.4-ext3merge/include/linux/jbd.h.=K0019=.orig 2003-03-14 18:20:37.000000000 +0000 +++ linux-2.4-ext3merge/include/linux/jbd.h 2003-03-14 18:21:03.000000000 +0000 @@ -348,6 +348,7 @@ struct handle_s /* Flags */ unsigned int h_sync: 1; /* sync-on-close */ + unsigned int h_flush: 1; /* flush/checkpoint-on-close */ unsigned int h_jdata: 1; /* force data journaling */ unsigned int h_aborted: 1; /* fatal error on handle */ };