diff options
author | Maciej Żenczykowski <zenczykowski@gmail.com> | 2010-10-27 21:30:06 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2010-10-27 21:30:06 -0400 |
commit | c41303ced67c4ebf51bf2e7d0f139155e09e0939 (patch) | |
tree | 6593e7d580d48c2229df94bac0412654a1a7f76e | |
parent | 2407518de63a2f80d9b850fb525f35df93bbbe53 (diff) |
ext4: don't update sb journal_devnum when RO dev
An ext4 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:
- ext4 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: "Theodore Ts'o" <tytso@mit.edu>
-rw-r--r-- | fs/ext4/super.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index c5b890140d01..8a24e9be7cb0 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -3908,7 +3908,7 @@ static int ext4_load_journal(struct super_block *sb, | |||
3908 | EXT4_SB(sb)->s_journal = journal; | 3908 | EXT4_SB(sb)->s_journal = journal; |
3909 | ext4_clear_journal_err(sb, es); | 3909 | ext4_clear_journal_err(sb, es); |
3910 | 3910 | ||
3911 | if (journal_devnum && | 3911 | if (!really_read_only && journal_devnum && |
3912 | journal_devnum != le32_to_cpu(es->s_journal_dev)) { | 3912 | journal_devnum != le32_to_cpu(es->s_journal_dev)) { |
3913 | es->s_journal_dev = cpu_to_le32(journal_devnum); | 3913 | es->s_journal_dev = cpu_to_le32(journal_devnum); |
3914 | 3914 | ||