Skip to content

Commit 2e84f26

Browse files
committed
jbd: don't write superblock when unmounting an ro filesystem
This sequence: results in an IO error when unmounting the RO filesystem. The bug was introduced by: commit 9754e39 Author: Jan Kara <jack@suse.cz> 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: <stable@vger.kernel.org> # 3.4.x Signed-off-by: Jan Kara <jack@suse.cz>
1 parent 48d1788 commit 2e84f26

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎fs/jbd/journal.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,6 +1113,11 @@ static void mark_journal_empty(journal_t *journal)
11131113

11141114
BUG_ON(!mutex_is_locked(&journal->j_checkpoint_mutex));
11151115
spin_lock(&journal->j_state_lock);
1116+
/* Is it already empty? */
1117+
if (sb->s_start == 0) {
1118+
spin_unlock(&journal->j_state_lock);
1119+
return;
1120+
}
11161121
jbd_debug(1, "JBD: Marking journal as empty (seq %d)\n",
11171122
journal->j_tail_sequence);
11181123

0 commit comments

Comments
 (0)