mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "John L. Hammond" <john.hammond@intel.com>
To: <greg@kroah.com>, <andreas.dilger@intel.com>, <oleg.drokin@intel.com>
Cc: <linux-kernel@vger.kernel.org>,
	"John L. Hammond" <john.hammond@intel.com>
Subject: [PATCH 09/12] staging/lustre/mgc: remove server specific llog handling
Date: Fri, 5 Sep 2014 15:08:15 -0500	[thread overview]
Message-ID: <1409947698-30781-10-git-send-email-john.hammond@intel.com> (raw)
In-Reply-To: <1409947698-30781-1-git-send-email-john.hammond@intel.com>

From: "John L. Hammond" <john.hammond@intel.com>

In mgc_process_cfg_log() remove code to handle
LLOG_CONFIG_ORIG_CTXT. This context is not setup on clients.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
---
 drivers/staging/lustre/lustre/mgc/mgc_request.c |   84 ++---------------------
 1 file changed, 4 insertions(+), 80 deletions(-)

diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c
index cb0e6f9..bc263ad 100644
--- a/drivers/staging/lustre/lustre/mgc/mgc_request.c
+++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c
@@ -1461,54 +1461,11 @@ out:
 	return rc;
 }
 
-static int mgc_llog_local_copy(const struct lu_env *env,
-			       struct obd_device *obd,
-			       struct llog_ctxt *rctxt,
-			       struct llog_ctxt *lctxt, char *logname)
-{
-	char	*temp_log;
-	int	 rc;
-
-
-
-	/*
-	 * - copy it to backup using llog_backup()
-	 * - copy remote llog to logname using llog_backup()
-	 * - if failed then move backup to logname again
-	 */
-
-	OBD_ALLOC(temp_log, strlen(logname) + 1);
-	if (!temp_log)
-		return -ENOMEM;
-	sprintf(temp_log, "%sT", logname);
-
-	/* make a copy of local llog at first */
-	rc = llog_backup(env, obd, lctxt, lctxt, logname, temp_log);
-	if (rc < 0 && rc != -ENOENT)
-		goto out;
-	/* copy remote llog to the local copy */
-	rc = llog_backup(env, obd, rctxt, lctxt, logname, logname);
-	if (rc == -ENOENT) {
-		/* no remote llog, delete local one too */
-		llog_erase(env, lctxt, NULL, logname);
-	} else if (rc < 0) {
-		/* error during backup, get local one back from the copy */
-		llog_backup(env, obd, lctxt, lctxt, temp_log, logname);
-out:
-		CERROR("%s: failed to copy remote log %s: rc = %d\n",
-		       obd->obd_name, logname, rc);
-	}
-	llog_erase(env, lctxt, NULL, temp_log);
-	OBD_FREE(temp_log, strlen(logname) + 1);
-	return rc;
-}
-
 /* local_only means it cannot get remote llogs */
 static int mgc_process_cfg_log(struct obd_device *mgc,
 			       struct config_llog_data *cld, int local_only)
 {
-	struct llog_ctxt	*ctxt, *lctxt = NULL;
-	struct dt_object        *cl_mgc_dir = mgc->u.cli.cl_mgc_configs_dir;
+	struct llog_ctxt	*ctxt;
 	struct lustre_sb_info	*lsi = NULL;
 	int			 rc = 0;
 	bool			 sptlrpc_started = false;
@@ -1538,40 +1495,9 @@ static int mgc_process_cfg_log(struct obd_device *mgc,
 	ctxt = llog_get_context(mgc, LLOG_CONFIG_REPL_CTXT);
 	LASSERT(ctxt);
 
-	lctxt = llog_get_context(mgc, LLOG_CONFIG_ORIG_CTXT);
-
-	/* Copy the setup log locally if we can. Don't mess around if we're
-	 * running an MGS though (logs are already local). */
-	if (lctxt && lsi && IS_SERVER(lsi) && !IS_MGS(lsi) &&
-	    cl_mgc_dir != NULL &&
-	    lu2dt_dev(cl_mgc_dir->do_lu.lo_dev) == lsi->lsi_dt_dev) {
-		if (!local_only)
-			/* Only try to copy log if we have the lock. */
-			rc = mgc_llog_local_copy(env, mgc, ctxt, lctxt,
-						 cld->cld_logname);
-		if (local_only || rc) {
-			if (llog_is_empty(env, lctxt, cld->cld_logname)) {
-				LCONSOLE_ERROR_MSG(0x13a,
-						   "Failed to get MGS log %s and no local copy.\n",
-						   cld->cld_logname);
-				rc = -ENOENT;
-				goto out_pop;
-			}
-			CDEBUG(D_MGC,
-			       "Failed to get MGS log %s, using local copy for now, will try to update later.\n",
-			       cld->cld_logname);
-		}
-		/* Now, whether we copied or not, start using the local llog.
-		 * If we failed to copy, we'll start using whatever the old
-		 * log has. */
-		llog_ctxt_put(ctxt);
-		ctxt = lctxt;
-		lctxt = NULL;
-	} else {
-		if (local_only) /* no local log at client side */ {
-			rc = -EIO;
-			goto out_pop;
-		}
+	if (local_only) /* no local log at client side */ {
+		rc = -EIO;
+		goto out_pop;
 	}
 
 	if (cld_is_sptlrpc(cld)) {
@@ -1587,8 +1513,6 @@ static int mgc_process_cfg_log(struct obd_device *mgc,
 
 out_pop:
 	__llog_ctxt_put(env, ctxt);
-	if (lctxt)
-		__llog_ctxt_put(env, lctxt);
 
 	/*
 	 * update settings on existing OBDs. doing it inside
-- 
1.7.9.5


  parent reply	other threads:[~2014-09-05 20:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-05 20:08 [PATCH 00/12] staging/lustre: yet more dead code removal John L. Hammond
2014-09-05 20:08 ` [PATCH 01/12] staging/lustre/lov: remove unused OBD methods John L. Hammond
2014-09-05 20:08 ` [PATCH 02/12] staging/lustre/osc: " John L. Hammond
2014-09-05 20:08 ` [PATCH 03/12] staging/lustre/osc: remove obsolete llog handling code John L. Hammond
2014-09-05 20:08 ` [PATCH 04/12] staging/lustre: remove obd_ost.h John L. Hammond
2014-09-05 20:08 ` [PATCH 05/12] staging/lustre/mdc: remove unused OBD methods John L. Hammond
2014-09-05 20:08 ` [PATCH 06/12] staging/lustre/mdc: inline llog methods John L. Hammond
2014-09-05 20:08 ` [PATCH 07/12] staging/lustre/mgc: inline mgc_cancel() John L. Hammond
2014-09-05 20:08 ` [PATCH 08/12] staging/lustre: remove unused OBD methods John L. Hammond
2014-09-05 20:08 ` John L. Hammond [this message]
2014-09-05 20:08 ` [PATCH 10/12] staging/lustre/ptlrpc: remove sptlrpc_conf_target_get_rules() John L. Hammond
2014-09-05 20:08 ` [PATCH 11/12] staging/lustre/obdclass: remove llog_ioctl.c John L. Hammond
2014-09-05 20:08 ` [PATCH 12/12] staging/lustre/obdclass: remove local_storage.[ch] John L. Hammond

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1409947698-30781-10-git-send-email-john.hammond@intel.com \
    --to=john.hammond@intel.com \
    --cc=andreas.dilger@intel.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg.drokin@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome