diff options
Diffstat (limited to 'fs/ubifs/sb.c')
-rw-r--r-- | fs/ubifs/sb.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/ubifs/sb.c b/fs/ubifs/sb.c index 96cb62c8a9dd..bf31b4729e51 100644 --- a/fs/ubifs/sb.c +++ b/fs/ubifs/sb.c | |||
@@ -542,11 +542,8 @@ int ubifs_read_superblock(struct ubifs_info *c) | |||
542 | * due to the unavailability of time-travelling equipment. | 542 | * due to the unavailability of time-travelling equipment. |
543 | */ | 543 | */ |
544 | if (c->fmt_version > UBIFS_FORMAT_VERSION) { | 544 | if (c->fmt_version > UBIFS_FORMAT_VERSION) { |
545 | struct super_block *sb = c->vfs_sb; | 545 | ubifs_assert(!c->ro_media || c->ro_mount); |
546 | int mounting_ro = sb->s_flags & MS_RDONLY; | 546 | if (!c->ro_mount || |
547 | |||
548 | ubifs_assert(!c->ro_media || mounting_ro); | ||
549 | if (!mounting_ro || | ||
550 | c->ro_compat_version > UBIFS_RO_COMPAT_VERSION) { | 547 | c->ro_compat_version > UBIFS_RO_COMPAT_VERSION) { |
551 | ubifs_err("on-flash format version is w%d/r%d, but " | 548 | ubifs_err("on-flash format version is w%d/r%d, but " |
552 | "software only supports up to version " | 549 | "software only supports up to version " |
@@ -624,7 +621,7 @@ int ubifs_read_superblock(struct ubifs_info *c) | |||
624 | c->old_leb_cnt = c->leb_cnt; | 621 | c->old_leb_cnt = c->leb_cnt; |
625 | if (c->leb_cnt < c->vi.size && c->leb_cnt < c->max_leb_cnt) { | 622 | if (c->leb_cnt < c->vi.size && c->leb_cnt < c->max_leb_cnt) { |
626 | c->leb_cnt = min_t(int, c->max_leb_cnt, c->vi.size); | 623 | c->leb_cnt = min_t(int, c->max_leb_cnt, c->vi.size); |
627 | if (c->vfs_sb->s_flags & MS_RDONLY) | 624 | if (c->ro_mount) |
628 | dbg_mnt("Auto resizing (ro) from %d LEBs to %d LEBs", | 625 | dbg_mnt("Auto resizing (ro) from %d LEBs to %d LEBs", |
629 | c->old_leb_cnt, c->leb_cnt); | 626 | c->old_leb_cnt, c->leb_cnt); |
630 | else { | 627 | else { |