From: girish Date: Wed, 21 Jan 2009 18:38:51 +0000 (+0000) Subject: b=16895 X-Git-Tag: v1_7_160~17 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=20396ffb2ec8e685c81d84e2d49f42c3451b0b69;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 3dceb6b..92fc846 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -1989,7 +1989,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 d906c40..facf13a 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -1890,7 +1890,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;