Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 31d710a7 authored by Maciej Żenczykowski's avatar Maciej Żenczykowski Committed by Jan Kara
Browse files

ext3: don't update sb journal_devnum when RO dev



An ext3 filesystem on a read-only device, with an external journal
which is at a different device number then recorded in the superblock
will fail to honor the read-only setting of the device and trigger
a superblock update (write).

For example:
  - ext3 on a software raid which is in read-only mode
  - external journal on a read-write device which has changed device num
  - attempt to mount with -o journal_dev=<new_number>
  - hits BUG_ON(mddev->ro = 1) in md.c

Cc: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: default avatarMaciej Żenczykowski <zenczykowski@gmail.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 3c0eee3f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2290,7 +2290,7 @@ static int ext3_load_journal(struct super_block *sb,
	EXT3_SB(sb)->s_journal = journal;
	ext3_clear_journal_err(sb, es);

	if (journal_devnum &&
	if (!really_read_only && journal_devnum &&
	    journal_devnum != le32_to_cpu(es->s_journal_dev)) {
		es->s_journal_dev = cpu_to_le32(journal_devnum);