From 20396ffb2ec8e685c81d84e2d49f42c3451b0b69 Mon Sep 17 00:00:00 2001 From: girish Date: Wed, 21 Jan 2009 18:38:51 +0000 Subject: [PATCH] b=16895 i=adilger (o=johann) i=girish don't LASSERT on read-only device --- lustre/mds/handler.c | 6 +++++- lustre/obdfilter/filter.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) 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; -- 1.8.3.1