Skip to content

Commit

Permalink
jbd: don't write superblock when unmounting an ro filesystem
Browse files Browse the repository at this point in the history
This sequence:

results in an IO error when unmounting the RO filesystem. The bug was
introduced by:

commit 9754e39
Author: Jan Kara <[email protected]>
Date:   Sat Apr 7 12:33:03 2012 +0200

    jbd: Split updating of journal superblock and marking journal empty

which lost some of the magic in journal_update_superblock() which
used to test for a journal with no outstanding transactions.

This is a port of a jbd2 fix by Eric Sandeen.

CC: <[email protected]> # 3.4.x
Signed-off-by: Jan Kara <[email protected]>
  • Loading branch information
jankara committed Aug 15, 2012
1 parent 48d1788 commit 2e84f26
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fs/jbd/journal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1113,6 +1113,11 @@ static void mark_journal_empty(journal_t *journal)

BUG_ON(!mutex_is_locked(&journal->j_checkpoint_mutex));
spin_lock(&journal->j_state_lock);
/* Is it already empty? */
if (sb->s_start == 0) {
spin_unlock(&journal->j_state_lock);
return;
}
jbd_debug(1, "JBD: Marking journal as empty (seq %d)\n",
journal->j_tail_sequence);

Expand Down

0 comments on commit 2e84f26

Please sign in to comment.