From: girish Date: Wed, 21 Jan 2009 18:38:40 +0000 (+0000) Subject: b=16895 X-Git-Tag: GIT_EPOCH_B1_6~2^5~235 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=0ef74b93bc934c6bdbe1403f11b51b303e570760;p=fs%2Flustre-release.git b=16895 i=adilger (o=johann) i=girish don't LASSERT on read-only device --- diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index b2c84ea..940e4f8 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -2057,7 +2057,11 @@ static int mds_setup(struct obd_device *obd, obd_count len, void *buf) CDEBUG(D_SUPER, "%s: mnt = %p\n", lustre_cfg_string(lcfg, 1), mnt); - LASSERT(!lvfs_check_rdonly(lvfs_sbdev(mnt->mnt_sb))); + if (lvfs_check_rdonly(lvfs_sbdev(mnt->mnt_sb))) { + CERROR("%s: Underlying device is marked as read-only. " + "Setup failed\n", obd->obd_name); + GOTO(err_ops, rc = -EROFS); + } sema_init(&mds->mds_epoch_sem, 1); spin_lock_init(&mds->mds_transno_lock); diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index 6a6e343..4d923a6 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -1763,7 +1763,11 @@ int filter_common_setup(struct obd_device *obd, obd_count len, void *buf, if (rc != 0) GOTO(err_ops, rc); - LASSERT(!lvfs_check_rdonly(lvfs_sbdev(mnt->mnt_sb))); + if (lvfs_check_rdonly(lvfs_sbdev(mnt->mnt_sb))) { + CERROR("%s: Underlying device is marked as read-only. " + "Setup failed\n", obd->obd_name); + GOTO(err_ops, rc = -EROFS); + } /* failover is the default */ obd->obd_replayable = 1;