From d587fb86342f153fa3f6d5e53a86bd1034e0dddd Mon Sep 17 00:00:00 2001 From: nathan Date: Tue, 2 May 2006 23:28:23 +0000 Subject: [PATCH] Branch b1_5 b=8007 Don't assume that unknown old targets are really part of the fs. --- lustre/mgs/mgs_handler.c | 19 ++++++++++--------- lustre/obdclass/obd_mount.c | 6 ++++++ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/lustre/mgs/mgs_handler.c b/lustre/mgs/mgs_handler.c index 94dc87c..87d6ded 100644 --- a/lustre/mgs/mgs_handler.c +++ b/lustre/mgs/mgs_handler.c @@ -313,7 +313,9 @@ static int mgs_put_cfg_lock(struct lustre_handle *lockh) RETURN(0); } -/* rc=0 means ok */ +/* rc=0 means ok + 1 means update + -1 means error */ static int mgs_check_target(struct obd_device *obd, struct mgs_target_info *mti) { int rc; @@ -321,11 +323,11 @@ static int mgs_check_target(struct obd_device *obd, struct mgs_target_info *mti) rc = mgs_check_index(obd, mti); if (rc == 0) { - LCONSOLE_ERROR("Index for %s has disappeared! " - "Regenerating this portion of the logs." - "\n", mti->mti_svname); - mti->mti_flags |= LDD_F_UPDATE; - rc = 1; + LCONSOLE_ERROR("%s claims to have registered, but this MGS " + "does not know about it. Resolve this issue " + "with tunefs.lustre on that device\n", + mti->mti_svname); + rc = -EINVAL; } else if (rc == -1) { LCONSOLE_ERROR("Client log %s-client has disappeared! " "Regenerating all logs.\n", @@ -340,7 +342,6 @@ static int mgs_check_target(struct obd_device *obd, struct mgs_target_info *mti) rc = mgs_check_failnid(obd, mti); } - RETURN(rc); } @@ -364,8 +365,8 @@ static int mgs_handle_target_reg(struct ptlrpc_request *req) mti->mti_svname, obd_export_nid2str(req->rq_export)); rc = mgs_check_target(obd, mti); /* above will set appropriate mti flags */ - if (!rc) - /* Nothing wrong, don't revoke lock */ + if (rc <= 0) + /* Nothing wrong, or fatal error */ GOTO(out_nolock, rc); } diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c index 01a9b1b..99b7da2 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -1064,6 +1064,12 @@ static int server_start_targets(struct super_block *sb, struct vfsmount *mnt) } GOTO(out, rc); } + if (rc == -EINVAL) { + LCONSOLE_ERROR("The MGS is refusing to allow this server (%s) " + "to start. Please see messages on the MGS node." + "\n", lsi->lsi_ldd->ldd_svname); + GOTO(out, rc); + } /* Let the target look up the mount using the target's name (we can't pass the sb or mnt through class_process_config.) */ -- 1.8.3.1