Fix a few buglets spotted by Jeff Mahoney . We're currently only checking for I/O errors against journal buffers if they were locked when they were first inspected. We need to check buffer_uptodate() even if the buffers were already unlocked. --- 25-akpm/fs/jbd/commit.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff -puN fs/jbd/commit.c~jbd-iobuf-error-handling-fix fs/jbd/commit.c --- 25/fs/jbd/commit.c~jbd-iobuf-error-handling-fix 2004-03-18 22:51:24.212947768 -0800 +++ 25-akpm/fs/jbd/commit.c 2004-03-18 22:52:08.411228608 -0800 @@ -535,11 +535,12 @@ wait_for_iobuf: bh = jh2bh(jh); if (buffer_locked(bh)) { wait_on_buffer(bh); - if (unlikely(!buffer_uptodate(bh))) - err = -EIO; goto wait_for_iobuf; } + if (unlikely(!buffer_uptodate(bh))) + err = -EIO; + clear_buffer_jwrite(bh); JBUFFER_TRACE(jh, "ph4: unfile after journal write"); @@ -595,11 +596,12 @@ wait_for_iobuf: bh = jh2bh(jh); if (buffer_locked(bh)) { wait_on_buffer(bh); - if (unlikely(!buffer_uptodate(bh))) - err = -EIO; goto wait_for_ctlbuf; } + if (unlikely(!buffer_uptodate(bh))) + err = -EIO; + BUFFER_TRACE(bh, "ph5: control buffer writeout done: unfile"); clear_buffer_jwrite(bh); journal_unfile_buffer(journal, jh); _