diff options
Diffstat (limited to 'fs/gfs2/recovery.c')
-rw-r--r-- | fs/gfs2/recovery.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/fs/gfs2/recovery.c b/fs/gfs2/recovery.c index beb6c7ac0086..b249e294a95b 100644 --- a/fs/gfs2/recovery.c +++ b/fs/gfs2/recovery.c | |||
@@ -391,7 +391,7 @@ static int clean_journal(struct gfs2_jdesc *jd, struct gfs2_log_header_host *hea | |||
391 | lblock = head->lh_blkno; | 391 | lblock = head->lh_blkno; |
392 | gfs2_replay_incr_blk(sdp, &lblock); | 392 | gfs2_replay_incr_blk(sdp, &lblock); |
393 | bh_map.b_size = 1 << ip->i_inode.i_blkbits; | 393 | bh_map.b_size = 1 << ip->i_inode.i_blkbits; |
394 | error = gfs2_block_map(&ip->i_inode, lblock, 0, &bh_map); | 394 | error = gfs2_block_map(&ip->i_inode, lblock, &bh_map, 0); |
395 | if (error) | 395 | if (error) |
396 | return error; | 396 | return error; |
397 | if (!bh_map.b_blocknr) { | 397 | if (!bh_map.b_blocknr) { |
@@ -504,13 +504,21 @@ int gfs2_recover_journal(struct gfs2_jdesc *jd) | |||
504 | if (!test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags)) | 504 | if (!test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags)) |
505 | ro = 1; | 505 | ro = 1; |
506 | } else { | 506 | } else { |
507 | if (sdp->sd_vfs->s_flags & MS_RDONLY) | 507 | if (sdp->sd_vfs->s_flags & MS_RDONLY) { |
508 | ro = 1; | 508 | /* check if device itself is read-only */ |
509 | ro = bdev_read_only(sdp->sd_vfs->s_bdev); | ||
510 | if (!ro) { | ||
511 | fs_info(sdp, "recovery required on " | ||
512 | "read-only filesystem.\n"); | ||
513 | fs_info(sdp, "write access will be " | ||
514 | "enabled during recovery.\n"); | ||
515 | } | ||
516 | } | ||
509 | } | 517 | } |
510 | 518 | ||
511 | if (ro) { | 519 | if (ro) { |
512 | fs_warn(sdp, "jid=%u: Can't replay: read-only FS\n", | 520 | fs_warn(sdp, "jid=%u: Can't replay: read-only block " |
513 | jd->jd_jid); | 521 | "device\n", jd->jd_jid); |
514 | error = -EROFS; | 522 | error = -EROFS; |
515 | goto fail_gunlock_tr; | 523 | goto fail_gunlock_tr; |
516 | } | 524 | } |