diff options
-rw-r--r-- | fs/ocfs2/journal.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c index 36304434eacf..e5dcea6cee5f 100644 --- a/fs/ocfs2/journal.c +++ b/fs/ocfs2/journal.c | |||
@@ -666,23 +666,24 @@ static int __ocfs2_journal_access(handle_t *handle, | |||
666 | /* we can safely remove this assertion after testing. */ | 666 | /* we can safely remove this assertion after testing. */ |
667 | if (!buffer_uptodate(bh)) { | 667 | if (!buffer_uptodate(bh)) { |
668 | mlog(ML_ERROR, "giving me a buffer that's not uptodate!\n"); | 668 | mlog(ML_ERROR, "giving me a buffer that's not uptodate!\n"); |
669 | mlog(ML_ERROR, "b_blocknr=%llu\n", | 669 | mlog(ML_ERROR, "b_blocknr=%llu, b_state=0x%lx\n", |
670 | (unsigned long long)bh->b_blocknr); | 670 | (unsigned long long)bh->b_blocknr, bh->b_state); |
671 | 671 | ||
672 | lock_buffer(bh); | 672 | lock_buffer(bh); |
673 | /* | 673 | /* |
674 | * A previous attempt to write this buffer head failed. | 674 | * A previous transaction with a couple of buffer heads fail |
675 | * Nothing we can do but to retry the write and hope for | 675 | * to checkpoint, so all the bhs are marked as BH_Write_EIO. |
676 | * the best. | 676 | * For current transaction, the bh is just among those error |
677 | * bhs which previous transaction handle. We can't just clear | ||
678 | * its BH_Write_EIO and reuse directly, since other bhs are | ||
679 | * not written to disk yet and that will cause metadata | ||
680 | * inconsistency. So we should set fs read-only to avoid | ||
681 | * further damage. | ||
677 | */ | 682 | */ |
678 | if (buffer_write_io_error(bh) && !buffer_uptodate(bh)) { | 683 | if (buffer_write_io_error(bh) && !buffer_uptodate(bh)) { |
679 | clear_buffer_write_io_error(bh); | ||
680 | set_buffer_uptodate(bh); | ||
681 | } | ||
682 | |||
683 | if (!buffer_uptodate(bh)) { | ||
684 | unlock_buffer(bh); | 684 | unlock_buffer(bh); |
685 | return -EIO; | 685 | return ocfs2_error(osb->sb, "A previous attempt to " |
686 | "write this buffer head failed\n"); | ||
686 | } | 687 | } |
687 | unlock_buffer(bh); | 688 | unlock_buffer(bh); |
688 | } | 689 | } |