diff options
author | Maciej Żenczykowski <zenczykowski@gmail.com> | 2010-09-26 08:38:28 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2011-01-06 05:52:14 -0500 |
commit | 31d710a7bd42f0d89e30d53bdaad427c5f191d0d (patch) | |
tree | 8f0d6e4786c8c0d58c39843a57119aef0015c55d /fs/ext3 | |
parent | 3c0eee3fe6a3a1c745379547c7e7c904aa64f6d5 (diff) |
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: Maciej Żenczykowski <zenczykowski@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext3')
-rw-r--r-- | fs/ext3/super.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index acf8695fa8f0..04169318e6ba 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c | |||
@@ -2290,7 +2290,7 @@ static int ext3_load_journal(struct super_block *sb, | |||
2290 | EXT3_SB(sb)->s_journal = journal; | 2290 | EXT3_SB(sb)->s_journal = journal; |
2291 | ext3_clear_journal_err(sb, es); | 2291 | ext3_clear_journal_err(sb, es); |
2292 | 2292 | ||
2293 | if (journal_devnum && | 2293 | if (!really_read_only && journal_devnum && |
2294 | journal_devnum != le32_to_cpu(es->s_journal_dev)) { | 2294 | journal_devnum != le32_to_cpu(es->s_journal_dev)) { |
2295 | es->s_journal_dev = cpu_to_le32(journal_devnum); | 2295 | es->s_journal_dev = cpu_to_le32(journal_devnum); |
2296 | 2296 | ||