From 676debb5ded5f4b7a991b56a8581343d4dde071b Mon Sep 17 00:00:00 2001 From: shadow Date: Thu, 14 Jun 2007 08:33:38 +0000 Subject: [PATCH] add macro LCONSOLE_ERROR_MSG with extra parameter and map LCONSOLE_ERROR(fmt, arg) to LCONSOLE_ERROR_MSG(0x000, fmt, ## arg). b=10595 i=adilger --- lustre/ldlm/ldlm_lib.c | 10 ++-- lustre/ldlm/ldlm_lockd.c | 10 ++-- lustre/ldlm/ldlm_resource.c | 13 ++--- lustre/liblustre/super.c | 6 +-- lustre/llite/llite_lib.c | 59 +++++++++++----------- lustre/lov/lov_qos.c | 6 +-- lustre/mds/mds_fs.c | 8 +-- lustre/mgc/mgc_request.c | 6 +-- lustre/mgs/mgs_handler.c | 23 ++++----- lustre/mgs/mgs_llog.c | 114 ++++++++++++++++++++++--------------------- lustre/obdclass/genops.c | 4 +- lustre/obdclass/obd_config.c | 4 +- lustre/obdclass/obd_mount.c | 69 ++++++++++++++------------ lustre/obdfilter/filter.c | 23 ++++----- lustre/osc/osc_request.c | 47 +++++++++--------- lustre/ost/ost_handler.c | 25 +++++----- lustre/ptlrpc/client.c | 10 ++-- lustre/ptlrpc/import.c | 18 +++---- 18 files changed, 237 insertions(+), 218 deletions(-) diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index 2844e8a..efab58d 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -578,11 +578,11 @@ int target_handle_connect(struct ptlrpc_request *req, svc_handler_t handler) /* end COMPAT_146 */ if (!target || target->obd_stopping || !target->obd_set_up) { - LCONSOLE_ERROR(0x137, "UUID '%s' is not available " - " for connect (%s)\n", str, - !target ? "no target" : - (target->obd_stopping ? "stopping" : - "not set up")); + LCONSOLE_ERROR_MSG(0x137, "UUID '%s' is not available " + " for connect (%s)\n", str, + !target ? "no target" : + (target->obd_stopping ? "stopping" : + "not set up")); GOTO(out, rc = -ENODEV); } diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index 0d355e5..fe9add7 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -419,11 +419,13 @@ static void ldlm_failed_ast(struct ldlm_lock *lock, int rc, struct ptlrpc_connection *conn = lock->l_export->exp_connection; char *str = libcfs_nid2str(conn->c_peer.nid); - LCONSOLE_ERROR(0x138, "A client on nid %s was evicted from " - "service %s.\n", str, lock->l_export->exp_obd->obd_name); + LCONSOLE_ERROR_MSG(0x138, "A client on nid %s was evicted from " + "service %s.\n", str, + lock->l_export->exp_obd->obd_name); - LCONSOLE_ERROR(0x012, "Lock %s callback to %s timed out for resource " - "%d\n", ast_type, obd_export_nid2str(lock->l_export), rc); + LCONSOLE_ERROR_MSG(0x012, "Lock %s callback to %s timed out for " + "resource %d\n", ast_type, + obd_export_nid2str(lock->l_export), rc); if (obd_dump_on_timeout) libcfs_debug_dumplog(); diff --git a/lustre/ldlm/ldlm_resource.c b/lustre/ldlm/ldlm_resource.c index 1687299..b209f13 100644 --- a/lustre/ldlm/ldlm_resource.c +++ b/lustre/ldlm/ldlm_resource.c @@ -431,12 +431,13 @@ int ldlm_namespace_free(struct ldlm_namespace *ns, int force) rc = l_wait_event(ns->ns_waitq, ns->ns_refcount == 0, &lwi); if (ns->ns_refcount) - LCONSOLE_ERROR(0x139, "Lock manager: wait for %s " - "namespace cleanup aborted with %d " - "resources in use. (%d)\nI'm going " - "to try to clean up anyway, but I " - "might need a reboot of this node.\n", - ns->ns_name, (int) ns->ns_refcount, rc); + LCONSOLE_ERROR_MSG(0x139, "Lock manager: wait for %s " + "namespace cleanup aborted with %d " + "resources in use. (%d)\nI'm going " + "to try to clean up anyway, but I " + "might need a reboot of this node.\n", + ns->ns_name, (int) ns->ns_refcount, + rc); CDEBUG(D_DLMTRACE, "dlm namespace %s free done waiting\n", ns->ns_name); } diff --git a/lustre/liblustre/super.c b/lustre/liblustre/super.c index cdd85e9..79a0fcb 100644 --- a/lustre/liblustre/super.c +++ b/lustre/liblustre/super.c @@ -1477,9 +1477,9 @@ static int llu_iop_fcntl(struct inode *ino, int cmd, va_list ap, int *rtn) flags = va_arg(ap, long); flags &= FCNTL_FLMASK; if (flags & FCNTL_FLMASK_INVALID) { - LCONSOLE_ERROR(0x010, "liblustre does not support " - "the O_NONBLOCK or O_ASYNC flags. " - "Please fix your application.\n"); + LCONSOLE_ERROR_MSG(0x010, "liblustre does not support " + "the O_NONBLOCK or O_ASYNC flags. " + "Please fix your application.\n"); *rtn = -EINVAL; err = EINVAL; break; diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index a71c086..06e4843 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -180,10 +180,10 @@ static int client_common_fill_super(struct super_block *sb, err = obd_connect(&mdc_conn, obd, &sbi->ll_sb_uuid, data); if (err == -EBUSY) { - LCONSOLE_ERROR(0x14f, "An MDT (mdc %s) is performing recovery," - " of which this client is not a part. Please " - "wait for recovery to complete, abort, or " - "time out.\n", mdc); + LCONSOLE_ERROR_MSG(0x14f, "An MDT (mdc %s) is performing " + "recovery, of which this client is not a " + "part. Please wait for recovery to complete," + " abort, or time out.\n", mdc); GOTO(out, err); } else if (err) { CERROR("cannot connect to %s: rc = %d\n", mdc, err); @@ -268,10 +268,10 @@ static int client_common_fill_super(struct super_block *sb, err = obd_connect(&osc_conn, obd, &sbi->ll_sb_uuid, data); if (err == -EBUSY) { - LCONSOLE_ERROR(0x150, "An OST (osc %s) is performing recovery," - " of which this client is not a part. Please " - "wait for recovery to complete, abort, or " - "time out.\n", osc); + LCONSOLE_ERROR_MSG(0x150, "An OST (osc %s) is performing " + "recovery, of which this client is not a " + "part. Please wait for recovery to " + "complete, abort, or time out.\n", osc); GOTO(out, err); } else if (err) { CERROR("cannot connect to %s: rc = %d\n", osc, err); @@ -287,9 +287,9 @@ static int client_common_fill_super(struct super_block *sb, err = obd_prep_async_page(sbi->ll_osc_exp, NULL, NULL, NULL, 0, NULL, NULL, NULL); if (err < 0) { - LCONSOLE_ERROR(0x151, "There are no OST's in this filesystem. " - "There must be at least one active OST for " - "a client to start.\n"); + LCONSOLE_ERROR_MSG(0x151, "There are no OST's in this " + "filesystem. There must be at least one " + "active OST for a client to start.\n"); GOTO(out_osc, err); } @@ -668,8 +668,8 @@ static int ll_options(char *options, int *flags) goto next; } - LCONSOLE_ERROR(0x152, "Unknown option '%s', won't mount.\n", - s1); + LCONSOLE_ERROR_MSG(0x152, "Unknown option '%s', won't mount.\n", + s1); RETURN(-EINVAL); next: @@ -766,9 +766,9 @@ static int old_lustre_process_log(struct super_block *sb, char *newprofile, rc = do_lcfg(MDCDEV, 0, LCFG_SETUP, mdt, niduuid, 0, 0); if (rc < 0) { - LCONSOLE_ERROR(0x153, "I couldn't establish a connection with " - "the MDT. Check that the MDT host NID is " - "correct and the networks are up.\n"); + LCONSOLE_ERROR_MSG(0x153, "I couldn't establish a connection " + "with the MDT. Check that the MDT host NID " + "is correct and the networks are up.\n"); GOTO(out_detach, rc); } @@ -839,18 +839,19 @@ static int old_lustre_process_log(struct super_block *sb, char *newprofile, break; } case -EINVAL: - LCONSOLE_ERROR(0x154, "%s: The configuration '%s' could not " - "be read from the MDT '%s'. Make sure this " - "client and the MDT are running compatible " - "versions of Lustre.\n", - obd->obd_name, profile, mdt); + LCONSOLE_ERROR_MSG(0x154, "%s: The configuration '%s' could not" + " be read from the MDT '%s'. Make sure this" + " client and the MDT are running compatible " + "versions of Lustre.\n", + obd->obd_name, profile, mdt); /* fall through */ default: - LCONSOLE_ERROR(0x155, "%s: The configuration '%s' could not " - "be read from the MDT '%s'. This may be the " - "result of communication errors between the " - "client and the MDT, or if the MDT is not " - "running.\n", obd->obd_name, profile, mdt); + LCONSOLE_ERROR_MSG(0x155, "%s: The configuration '%s' could not" + " be read from the MDT '%s'. This may be " + "the result of communication errors between " + "the client and the MDT, or if the MDT is " + "not running.\n", obd->obd_name, profile, + mdt); break; } @@ -956,9 +957,9 @@ int ll_fill_super(struct super_block *sb) lprof = class_get_profile(profilenm); if (lprof == NULL) { - LCONSOLE_ERROR(0x156, "The client profile '%s' could not be " - "read from the MGS. Does that filesystem " - "exist?\n", profilenm); + LCONSOLE_ERROR_MSG(0x156, "The client profile '%s' could not be" + " read from the MGS. Does that filesystem " + "exist?\n", profilenm); GOTO(out_free, err = -EINVAL); } CDEBUG(D_CONFIG, "Found profile %s: mdc=%s osc=%s\n", profilenm, diff --git a/lustre/lov/lov_qos.c b/lustre/lov/lov_qos.c index 17e8822..61f0176 100644 --- a/lustre/lov/lov_qos.c +++ b/lustre/lov/lov_qos.c @@ -379,9 +379,9 @@ static int qos_calc_rr(struct lov_obd *lov) if (placed != real_count) { /* This should never happen */ - LCONSOLE_ERROR(0x14e, "Failed to place all OSTs in the " - "round-robin list (%d of %d).\n", - placed, real_count); + LCONSOLE_ERROR_MSG(0x14e, "Failed to place all OSTs in the " + "round-robin list (%d of %d).\n", + placed, real_count); for (i = 0; i < ost_count; i++) { LCONSOLE(D_WARNING, "rr #%d ost idx=%d\n", i, lov->lov_qos.lq_rr_array[i]); diff --git a/lustre/mds/mds_fs.c b/lustre/mds/mds_fs.c index 043caf9..f252c49 100644 --- a/lustre/mds/mds_fs.c +++ b/lustre/mds/mds_fs.c @@ -297,10 +297,10 @@ static int mds_init_server_data(struct obd_device *obd, struct file *file) GOTO(err_msd, rc); } if (strcmp(lsd->lsd_uuid, obd->obd_uuid.uuid) != 0) { - LCONSOLE_ERROR(0x157, "Trying to start OBD %s using " - "the wrong disk %s. Were the /dev/ " - "assignments rearranged?\n", - obd->obd_uuid.uuid, lsd->lsd_uuid); + LCONSOLE_ERROR_MSG(0x157, "Trying to start OBD %s using" + " the wrong disk %s. Were the /dev/ " + "assignments rearranged?\n", + obd->obd_uuid.uuid, lsd->lsd_uuid); GOTO(err_msd, rc = -EINVAL); } /* COMPAT_146 */ diff --git a/lustre/mgc/mgc_request.c b/lustre/mgc/mgc_request.c index 20c7b97..30399e9 100644 --- a/lustre/mgc/mgc_request.c +++ b/lustre/mgc/mgc_request.c @@ -1073,9 +1073,9 @@ static int mgc_process_log(struct obd_device *mgc, rc = mgc_copy_llog(mgc, ctxt, lctxt, cld->cld_logname); if (rcl || rc) { if (mgc_llog_is_empty(mgc, lctxt, cld->cld_logname)) { - LCONSOLE_ERROR(0x13a, "Failed to get MGS " - "log %s and no local copy.\n", - cld->cld_logname); + LCONSOLE_ERROR_MSG(0x13a, "Failed to get MGS " + "log %s and no local copy." + "\n", cld->cld_logname); GOTO(out_pop, rc = -ENOTCONN); } LCONSOLE_WARN("Failed to get MGS log %s, using " diff --git a/lustre/mgs/mgs_handler.c b/lustre/mgs/mgs_handler.c index cd941f2..4167ddd 100644 --- a/lustre/mgs/mgs_handler.c +++ b/lustre/mgs/mgs_handler.c @@ -322,15 +322,15 @@ 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(0x13b, "%s claims to have registered, but this " - "MGS does not know about it. Assuming " - "writeconf.\n", mti->mti_svname); + LCONSOLE_ERROR_MSG(0x13b, "%s claims to have registered, but " + "this MGS does not know about it. Assuming " + "writeconf.\n", mti->mti_svname); mti->mti_flags |= LDD_F_WRITECONF; rc = 1; } else if (rc == -1) { - LCONSOLE_ERROR(0x13c, "Client log %s-client has disappeared! " - "Regenerating all logs.\n", - mti->mti_fsname); + LCONSOLE_ERROR_MSG(0x13c, "Client log %s-client has " + "disappeared! Regenerating all logs.\n", + mti->mti_fsname); mti->mti_flags |= LDD_F_WRITECONF; rc = 1; } else { @@ -375,11 +375,12 @@ static int mgs_handle_target_reg(struct ptlrpc_request *req) revoke at the end they will just update from where they left off. */ lockrc = mgs_get_cfg_lock(obd, mti->mti_fsname, &lockh); if (lockrc != ELDLM_OK) { - LCONSOLE_ERROR(0x13d, "%s: Can't signal other nodes to update " - "their configuration (%d). Updating local logs " - "anyhow; you might have to manually restart " - "other nodes to get the latest configuration.\n", - obd->obd_name, lockrc); + LCONSOLE_ERROR_MSG(0x13d, "%s: Can't signal other nodes to " + "update their configuration (%d). Updating " + "local logs anyhow; you might have to " + "manually restart other nodes to get the " + "latest configuration.\n", + obd->obd_name, lockrc); } OBD_FAIL_TIMEOUT(OBD_FAIL_MGS_SLOW_TARGET_REG, 10); diff --git a/lustre/mgs/mgs_llog.c b/lustre/mgs/mgs_llog.c index 8688e28..3d8b607 100644 --- a/lustre/mgs/mgs_llog.c +++ b/lustre/mgs/mgs_llog.c @@ -463,24 +463,25 @@ int mgs_set_index(struct obd_device *obd, struct mgs_target_info *mti) /* Remove after CMD */ if ((mti->mti_flags & LDD_F_SV_TYPE_MDT) && (mti->mti_stripe_index > 0)) { - LCONSOLE_ERROR(0x13e, "MDT index must = 0 (until Clustered " - "MetaData feature is ready.)\n"); + LCONSOLE_ERROR_MSG(0x13e, "MDT index must = 0 (until Clustered " + "MetaData feature is ready.)\n"); mti->mti_stripe_index = 0; } if (mti->mti_stripe_index >= INDEX_MAP_SIZE * 8) { - LCONSOLE_ERROR(0x13f, "Server %s requested index %d, but the" - "max index is %d.\n", - mti->mti_svname, mti->mti_stripe_index, - INDEX_MAP_SIZE * 8); + LCONSOLE_ERROR_MSG(0x13f, "Server %s requested index %d, but the" + "max index is %d.\n", + mti->mti_svname, mti->mti_stripe_index, + INDEX_MAP_SIZE * 8); RETURN(-ERANGE); } if (test_bit(mti->mti_stripe_index, imap)) { if (mti->mti_flags & LDD_F_VIRGIN) { - LCONSOLE_ERROR(0x140, "Server %s requested index %d, " - "but that index is already in use\n", - mti->mti_svname, mti->mti_stripe_index); + LCONSOLE_ERROR_MSG(0x140, "Server %s requested index " + "%d, but that index is already in " + "use\n", mti->mti_svname, + mti->mti_stripe_index); RETURN(-EADDRINUSE); } else { CDEBUG(D_MGS, "Server %s updating index %d\n", @@ -1203,11 +1204,11 @@ static int mgs_write_log_ost(struct obd_device *obd, struct fs_db *fsdb, /* If the ost log already exists, that means that someone reformatted the ost and it called target_add again. */ if (!mgs_log_is_empty(obd, mti->mti_svname)) { - LCONSOLE_ERROR(0x141, "The config log for %s already exists, " - "yet the server claims it never registered. " - "It may have been reformatted, or the index " - " changed. writeconf the MDT to regenerate " - "all logs.\n", mti->mti_svname); + LCONSOLE_ERROR_MSG(0x141, "The config log for %s already " + "exists, yet the server claims it never " + "registered. It may have been reformatted, " + "or the index changed. writeconf the MDT to " + "regenerate all logs.\n", mti->mti_svname); RETURN(-EALREADY); } /* @@ -1287,9 +1288,9 @@ static int mgs_write_log_add_failnid(struct obd_device *obd, struct fs_db *fsdb, /* Verify that we know about this target */ if (mgs_log_is_empty(obd, mti->mti_svname)) { - LCONSOLE_ERROR(0x142, "The target %s has not registered yet. " - "It must be started before failnids can " - "be added.\n", mti->mti_svname); + LCONSOLE_ERROR_MSG(0x142, "The target %s has not registered " + "yet. It must be started before failnids can" + " be added.\n", mti->mti_svname); RETURN(-ENOENT); } @@ -1303,11 +1304,11 @@ static int mgs_write_log_add_failnid(struct obd_device *obd, struct fs_db *fsdb, } else if (mti->mti_flags & LDD_F_SV_TYPE_OST) { /* COMPAT_146 */ if (fsdb->fsdb_flags & FSDB_OLDLOG14) { - LCONSOLE_ERROR(0x143, "Failover NIDs cannot be added to" - " upgraded client logs for %s. Consider " - "updating the configuration with " - "--writeconf.\n", - mti->mti_svname); + LCONSOLE_ERROR_MSG(0x143, "Failover NIDs cannot be " + "added to upgraded client logs for " + "%s. Consider updating the " + "configuration with --writeconf.\n", + mti->mti_svname); RETURN(-EINVAL); } name_create(&cliname, mti->mti_svname, "-osc"); @@ -1415,9 +1416,9 @@ static int mgs_write_log_params(struct obd_device *obd, struct fs_db *fsdb, /* Processed in mgs_write_log_ost */ if (class_match_param(ptr, PARAM_FAILMODE, NULL) == 0) { if (mti->mti_flags & LDD_F_PARAM) { - LCONSOLE_ERROR(0x169, "%s can only be changed " - "with tunefs.lustre and " - "--writeconf\n", ptr); + LCONSOLE_ERROR_MSG(0x169, "%s can only be " + "changed with tunefs.lustre " + "and --writeconf\n", ptr); rc = -EPERM; } goto end_while; @@ -1457,9 +1458,9 @@ static int mgs_write_log_params(struct obd_device *obd, struct fs_db *fsdb, /* active=0 means off, anything else means on */ int flag = (*tmp == '0') ? CM_EXCLUDE : 0; if (!(mti->mti_flags & LDD_F_SV_TYPE_OST)) { - LCONSOLE_ERROR(0x144, "%s: Only OSCs can be " - "(de)activated.\n", - mti->mti_svname); + LCONSOLE_ERROR_MSG(0x144, "%s: Only OSCs can be" + " (de)activated.\n", + mti->mti_svname); rc = -EINVAL; goto end_while; } @@ -1480,12 +1481,13 @@ static int mgs_write_log_params(struct obd_device *obd, struct fs_db *fsdb, name_destroy(&logname); active_err: if (rc) { - LCONSOLE_ERROR(0x145, "Couldn't find %s in " - "log (%d). No permanent changes were made " - "to the config log.\n", - mti->mti_svname, rc); + LCONSOLE_ERROR_MSG(0x145, "Couldn't find %s in " + "log (%d). No permanent " + "changes were made to the " + "config log.\n", + mti->mti_svname, rc); if (fsdb->fsdb_flags & FSDB_OLDLOG14) - LCONSOLE_ERROR(0x146, "This may be " + LCONSOLE_ERROR_MSG(0x146, "This may be " "because the log is in the old 1.4 " "style. Consider --writeconf to " "update the logs.\n"); @@ -1501,9 +1503,10 @@ active_err: if (class_match_param(ptr, PARAM_LOV, NULL) == 0) { CDEBUG(D_MGS, "lov param %s\n", ptr); if (!(mti->mti_flags & LDD_F_SV_TYPE_MDT)) { - LCONSOLE_ERROR(0x147, "LOV params must be set " - "on the MDT, not %s. " - "Ignoring.\n", mti->mti_svname); + LCONSOLE_ERROR_MSG(0x147, "LOV params must be " + "set on the MDT, not %s. " + "Ignoring.\n", + mti->mti_svname); rc = 0; goto end_while; } @@ -1545,8 +1548,8 @@ active_err: } else if (mti->mti_flags & LDD_F_SV_TYPE_OST) { /* COMPAT_146 */ if (fsdb->fsdb_flags & FSDB_OLDLOG14) { - LCONSOLE_ERROR(0x148, "Upgraded client " - "logs for %s cannot be modified. " + LCONSOLE_ERROR_MSG(0x148, "Upgraded client" + " logs for %s cannot be modified. " "Consider updating the " "configuration with --writeconf\n", mti->mti_svname); @@ -1667,12 +1670,12 @@ int mgs_write_log_target(struct obd_device *obd, "upgrading\n", mti->mti_stripe_index, mti->mti_svname); } else { - LCONSOLE_ERROR(0x149, "Failed to find %s in the old " - "client log. Apparently it is not part " - "of this filesystem, or the old log is " - "wrong.\nUse 'writeconf' on the MDT to " - "force log regeneration.\n", - mti->mti_svname); + LCONSOLE_ERROR_MSG(0x149, "Failed to find %s in the old" + " client log. Apparently it is not " + "part of this filesystem, or the old" + " log is wrong.\nUse 'writeconf' on " + "the MDT to force log regeneration." + "\n", mti->mti_svname); /* Not in client log? Upgrade anyhow...*/ /* Argument against upgrading: reformat MDT, upgrade OST, then OST will start but will be SKIPped @@ -1762,9 +1765,9 @@ int mgs_upgrade_sv_14(struct obd_device *obd, struct mgs_target_info *mti) RETURN(rc); if (fsdb->fsdb_flags & FSDB_LOG_EMPTY) { - LCONSOLE_ERROR(0x14a, "The old client log %s-client is " - "missing. Was tunefs.lustre successful?\n", - mti->mti_fsname); + LCONSOLE_ERROR_MSG(0x14a, "The old client log %s-client is " + "missing. Was tunefs.lustre successful?\n", + mti->mti_fsname); RETURN(-ENOENT); } @@ -1776,9 +1779,10 @@ int mgs_upgrade_sv_14(struct obd_device *obd, struct mgs_target_info *mti) if (mti->mti_flags & LDD_F_SV_TYPE_MDT) { if (mgs_log_is_empty(obd, mti->mti_svname)) { - LCONSOLE_ERROR(0x14b, "The old MDT log %s is missing. " - "Was tunefs.lustre successful?\n", - mti->mti_svname); + LCONSOLE_ERROR_MSG(0x14b, "The old MDT log %s is " + "missing. Was tunefs.lustre " + "successful?\n", + mti->mti_svname); RETURN(-ENOENT); } @@ -1795,10 +1799,10 @@ int mgs_upgrade_sv_14(struct obd_device *obd, struct mgs_target_info *mti) } if (!(fsdb->fsdb_flags & FSDB_OLDLOG14)) { - LCONSOLE_ERROR(0x14c, "%s-client is supposedly an old log, " - "but no old LOV or MDT was found. Consider " - "updating the configuration with " - "--writeconf.\n", mti->mti_fsname); + LCONSOLE_ERROR_MSG(0x14c, "%s-client is supposedly an old log, " + "but no old LOV or MDT was found. Consider " + "updating the configuration with " + "--writeconf.\n", mti->mti_fsname); } RETURN(rc); @@ -1916,7 +1920,7 @@ int mgs_setparam(struct obd_device *obd, struct lustre_cfg *lcfg, char *fsname) } } if (!devname) { - LCONSOLE_ERROR(0x14d, "No target specified: %s\n", param); + LCONSOLE_ERROR_MSG(0x14d, "No target specified: %s\n", param); RETURN(-ENOSYS); } diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c index 2137f2f..924d717 100644 --- a/lustre/obdclass/genops.c +++ b/lustre/obdclass/genops.c @@ -105,8 +105,8 @@ struct obd_type *class_get_type(const char *name) CDEBUG(D_INFO, "Loaded module '%s'\n", modname); type = class_search_type(name); } else { - LCONSOLE_ERROR(0x158, "Can't load module '%s'\n", - modname); + LCONSOLE_ERROR_MSG(0x158, "Can't load module '%s'\n", + modname); } } #endif diff --git a/lustre/obdclass/obd_config.c b/lustre/obdclass/obd_config.c index 1d9f425..cae3b62 100644 --- a/lustre/obdclass/obd_config.c +++ b/lustre/obdclass/obd_config.c @@ -98,7 +98,7 @@ int class_parse_nid(char *buf, lnet_nid_t *nid, char **endh) *endp = '\0'; *nid = libcfs_str2nid(buf); if (*nid == LNET_NID_ANY) { - LCONSOLE_ERROR(0x159, "Can't parse NID '%s'\n", buf); + LCONSOLE_ERROR_MSG(0x159, "Can't parse NID '%s'\n", buf); *endp = tmp; return -EINVAL; } @@ -735,7 +735,7 @@ int class_process_config(struct lustre_cfg *lcfg) GOTO(out, err = 0); } case LCFG_SET_UPCALL: { - LCONSOLE_ERROR(0x15a, "recovery upcall is deprecated\n"); + LCONSOLE_ERROR_MSG(0x15a, "recovery upcall is deprecated\n"); /* COMPAT_146 Don't fail on old configs */ GOTO(out, err = 0); } diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c index 3a89bae..73b5d20 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -362,19 +362,20 @@ int lustre_process_log(struct super_block *sb, char *logname, lustre_cfg_free(lcfg); if (rc == -EINVAL) - LCONSOLE_ERROR(0x15b, "%s: The configuration from log '%s' " - "failed (%d). Make sure this client and " - "the MGS are running compatible versions of " - "Lustre.\n", - mgc->obd_name, logname, rc); + LCONSOLE_ERROR_MSG(0x15b, "%s: The configuration from log '%s' " + "failed (%d). Make sure this client and " + "the MGS are running compatible versions of " + "Lustre.\n", + mgc->obd_name, logname, rc); if (rc) - LCONSOLE_ERROR(0x15c, "%s: The configuration from log '%s' " - "failed (%d). This may be the result of " - "communication errors between this node and " - "the MGS, a bad configuration, or other errors." - " See the syslog for more information.\n", - mgc->obd_name, logname, rc); + LCONSOLE_ERROR_MSG(0x15c, "%s: The configuration from log '%s' " + "failed (%d). This may be the result of " + "communication errors between this node and " + "the MGS, a bad configuration, or other " + "errors. See the syslog for more " + "information.\n", mgc->obd_name, logname, + rc); /* class_obd_list(); */ RETURN(rc); @@ -468,8 +469,8 @@ static int server_start_mgs(struct super_block *sb) lmi = server_find_mount(LUSTRE_MGS_OBDNAME); if (lmi) { lsi = s2lsi(lmi->lmi_sb); - LCONSOLE_ERROR(0x15d, "The MGS service was already started " - "from server %s\n", lsi->lsi_ldd->ldd_svname); + LCONSOLE_ERROR_MSG(0x15d, "The MGS service was already started " + "from server %s\n", lsi->lsi_ldd->ldd_svname); RETURN(-EALREADY); } @@ -483,8 +484,9 @@ static int server_start_mgs(struct super_block *sb) server_deregister_mount(LUSTRE_MGS_OBDNAME); if (rc) - LCONSOLE_ERROR(0x15e, "Failed to start MGS '%s' (%d). Is the " - "'mgs' module loaded?\n", LUSTRE_MGS_OBDNAME, rc); + LCONSOLE_ERROR_MSG(0x15e, "Failed to start MGS '%s' (%d). Is " + "the 'mgs' module loaded?\n", + LUSTRE_MGS_OBDNAME, rc); RETURN(rc); } @@ -1048,15 +1050,16 @@ static int server_start_targets(struct super_block *sb, struct vfsmount *mnt) CERROR("Required registration failed for %s: %d\n", lsi->lsi_ldd->ldd_svname, rc); if (rc == -EIO) { - LCONSOLE_ERROR(0x15f, "Communication error with the " - "MGS. Is the MGS running?\n"); + LCONSOLE_ERROR_MSG(0x15f, "Communication error with the" + " MGS. Is the MGS running?\n"); } GOTO(out_mgc, rc); } if (rc == -EINVAL) { - LCONSOLE_ERROR(0x160, "The MGS is refusing to allow this " - "server (%s) to start. Please see messages on" - " the MGS node.\n", lsi->lsi_ldd->ldd_svname); + LCONSOLE_ERROR_MSG(0x160, "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_mgc, rc); } @@ -1539,9 +1542,10 @@ static int server_fill_super(struct super_block *sb) lsi->lsi_lmd->lmd_dev); if (class_name2obd(lsi->lsi_ldd->ldd_svname)) { - LCONSOLE_ERROR(0x161, "The target named %s is already running." - " Double-mount may have compromised the disk " - "journal.\n", lsi->lsi_ldd->ldd_svname); + LCONSOLE_ERROR_MSG(0x161, "The target named %s is already " + "running. Double-mount may have compromised " + "the disk journal.\n", + lsi->lsi_ldd->ldd_svname); unlock_mntput(mnt); lustre_put_lsi(sb); GOTO(out, rc = -EALREADY); @@ -1751,16 +1755,16 @@ static int lmd_parse(char *options, struct lustre_mount_data *lmd) LASSERT(lmd); if (!options) { - LCONSOLE_ERROR(0x162, "Missing mount data: check that " - "/sbin/mount.lustre is installed.\n"); + LCONSOLE_ERROR_MSG(0x162, "Missing mount data: check that " + "/sbin/mount.lustre is installed.\n"); RETURN(-EINVAL); } /* Options should be a string - try to detect old lmd data */ if ((raw->lmd_magic & 0xffffff00) == (LMD_MAGIC & 0xffffff00)) { - LCONSOLE_ERROR(0x163, "You're using an old version of " - "/sbin/mount.lustre. Please install version " - "%s\n", LUSTRE_VERSION_STRING); + LCONSOLE_ERROR_MSG(0x163, "You're using an old version of " + "/sbin/mount.lustre. Please install " + "version %s\n", LUSTRE_VERSION_STRING); RETURN(-EINVAL); } lmd->lmd_magic = LMD_MAGIC; @@ -1818,8 +1822,8 @@ static int lmd_parse(char *options, struct lustre_mount_data *lmd) } if (!devname) { - LCONSOLE_ERROR(0x164, "Can't find the device name " - "(need mount option 'device=...')\n"); + LCONSOLE_ERROR_MSG(0x164, "Can't find the device name " + "(need mount option 'device=...')\n"); goto invalid; } @@ -1888,8 +1892,9 @@ int lustre_fill_super(struct super_block *sb, void *data, int silent) if (lmd_is_client(lmd)) { CDEBUG(D_MOUNT, "Mounting client %s\n", lmd->lmd_profile); if (!client_fill_super) { - LCONSOLE_ERROR(0x165, "Nothing registered for client " - "mount! Is the 'lustre' module loaded?\n"); + LCONSOLE_ERROR_MSG(0x165, "Nothing registered for " + "client mount! Is the 'lustre' " + "module loaded?\n"); rc = -ENODEV; } else { rc = lustre_start_mgc(sb); diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index cac36f0..aa57346 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -663,10 +663,10 @@ static int filter_init_server_data(struct obd_device *obd, struct file * filp) GOTO(err_fsd, rc); } if (strcmp(fsd->lsd_uuid, obd->obd_uuid.uuid) != 0) { - LCONSOLE_ERROR(0x134, "Trying to start OBD %s using " - "the wrong disk %s. Were the /dev/ " - "assignments rearranged?\n", - obd->obd_uuid.uuid, fsd->lsd_uuid); + LCONSOLE_ERROR_MSG(0x134, "Trying to start OBD %s using" + " the wrong disk %s. Were the /dev/ " + "assignments rearranged?\n", + obd->obd_uuid.uuid, fsd->lsd_uuid); GOTO(err_fsd, rc = -EINVAL); } mount_count = le64_to_cpu(fsd->lsd_mount_count); @@ -1645,8 +1645,8 @@ int filter_common_setup(struct obd_device *obd, obd_count len, void *buf, lustre_cfg_string(lcfg, 1), option); if (IS_ERR(mnt)) { rc = PTR_ERR(mnt); - LCONSOLE_ERROR(0x135, "Can't mount disk %s (%d)\n", - lustre_cfg_string(lcfg, 1), rc); + LCONSOLE_ERROR_MSG(0x135, "Can't mount disk %s (%d)\n", + lustre_cfg_string(lcfg, 1), rc); RETURN(rc); } @@ -1980,11 +1980,12 @@ static int filter_connect_internal(struct obd_export *exp, filter_update_server_data(exp->exp_obd, filter->fo_rcvd_filp, lsd, 1); } else if (index != data->ocd_index) { - LCONSOLE_ERROR(0x136, "Connection from %s to index %u " - "doesn't match actual OST index %u in " - "last_rcvd file, bad configuration?\n", - obd_export_nid2str(exp), index, - data->ocd_index); + LCONSOLE_ERROR_MSG(0x136, "Connection from %s to index " + "%u doesn't match actual OST index " + "%u in last_rcvd file, bad " + "configuration?\n", + obd_export_nid2str(exp), index, + data->ocd_index); RETURN(-EBADF); } } diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index a0af12b..a2f9c48 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -1032,15 +1032,17 @@ static int check_write_checksum(struct obdo *oa, const lnet_process_id_t *peer, msg = "changed in transit AND doesn't match the original - " "likely false positive due to mmap IO (bug 11742)"; - LCONSOLE_ERROR(0x132, "BAD WRITE CHECKSUM: %s: from %s inum "LPU64"/"LPU64 - " object "LPU64"/"LPU64" extent ["LPU64"-"LPU64"]\n", - msg, libcfs_nid2str(peer->nid), - oa->o_valid & OBD_MD_FLFID ? oa->o_fid : (__u64)0, - oa->o_valid & OBD_MD_FLFID ? oa->o_generation : (__u64)0, - oa->o_id, - oa->o_valid & OBD_MD_FLGROUP ? oa->o_gr : (__u64)0, - pga[0]->off, - pga[page_count-1]->off + pga[page_count-1]->count - 1); + LCONSOLE_ERROR_MSG(0x132, "BAD WRITE CHECKSUM: %s: from %s inum " + LPU64"/"LPU64" object "LPU64"/"LPU64" extent " + "["LPU64"-"LPU64"]\n", + msg, libcfs_nid2str(peer->nid), + oa->o_valid & OBD_MD_FLFID ? oa->o_fid : (__u64)0, + oa->o_valid & OBD_MD_FLFID ? oa->o_generation : + (__u64)0, + oa->o_id, + oa->o_valid & OBD_MD_FLGROUP ? oa->o_gr : (__u64)0, + pga[0]->off, + pga[page_count-1]->off + pga[page_count-1]->count - 1); CERROR("original client csum %x, server csum %x, client csum now %x\n", client_cksum, server_cksum, new_cksum); @@ -1143,22 +1145,23 @@ static int osc_brw_fini_request(struct ptlrpc_request *req, int rc) "but please tell CFS.\n", libcfs_nid2str(peer->nid)); } else if (server_cksum != client_cksum) { - LCONSOLE_ERROR(0x133, "%s: BAD READ CHECKSUM: from %s" - "%s%s inum "LPU64"/"LPU64" object "LPU64 - "/"LPU64" extent ["LPU64"-"LPU64"]\n", - req->rq_import->imp_obd->obd_name, - libcfs_nid2str(peer->nid), - via, router, - body->oa.o_valid & OBD_MD_FLFID ? + LCONSOLE_ERROR_MSG(0x133, "%s: BAD READ CHECKSUM: from " + "%s%s%s inum "LPU64"/"LPU64" object " + LPU64"/"LPU64" extent " + "["LPU64"-"LPU64"]\n", + req->rq_import->imp_obd->obd_name, + libcfs_nid2str(peer->nid), + via, router, + body->oa.o_valid & OBD_MD_FLFID ? body->oa.o_fid : (__u64)0, - body->oa.o_valid & OBD_MD_FLFID ? + body->oa.o_valid & OBD_MD_FLFID ? body->oa.o_generation :(__u64)0, - body->oa.o_id, - body->oa.o_valid & OBD_MD_FLGROUP ? + body->oa.o_id, + body->oa.o_valid & OBD_MD_FLGROUP ? body->oa.o_gr : (__u64)0, - aa->aa_ppga[0]->off, - aa->aa_ppga[aa->aa_page_count-1]->off + - aa->aa_ppga[aa->aa_page_count-1]->count - + aa->aa_ppga[0]->off, + aa->aa_ppga[aa->aa_page_count-1]->off + + aa->aa_ppga[aa->aa_page_count-1]->count - 1); CERROR("client %x, server %x\n", client_cksum, server_cksum); diff --git a/lustre/ost/ost_handler.c b/lustre/ost/ost_handler.c index e6d67de..3814526 100644 --- a/lustre/ost/ost_handler.c +++ b/lustre/ost/ost_handler.c @@ -1078,21 +1078,22 @@ static int ost_brw_write(struct ptlrpc_request *req, struct obd_trans_info *oti) router = libcfs_nid2str(desc->bd_sender); } - LCONSOLE_ERROR(0x168, "%s: BAD WRITE CHECKSUM: %s from %s%s%s " - "inum "LPU64"/"LPU64" object "LPU64"/"LPU64 - " extent ["LPU64"-"LPU64"]\n", - req->rq_export->exp_obd->obd_name, msg, - libcfs_id2str(req->rq_peer), - via, router, - body->oa.o_valid & OBD_MD_FLFID ? + LCONSOLE_ERROR_MSG(0x168, "%s: BAD WRITE CHECKSUM: %s from %s" + "%s%s inum "LPU64"/"LPU64" object "LPU64"/" + LPU64" extent ["LPU64"-"LPU64"]\n", + req->rq_export->exp_obd->obd_name, msg, + libcfs_id2str(req->rq_peer), + via, router, + body->oa.o_valid & OBD_MD_FLFID ? body->oa.o_fid : (__u64)0, - body->oa.o_valid & OBD_MD_FLFID ? + body->oa.o_valid & OBD_MD_FLFID ? body->oa.o_generation :(__u64)0, - body->oa.o_id, - body->oa.o_valid & OBD_MD_FLGROUP ? + body->oa.o_id, + body->oa.o_valid & OBD_MD_FLGROUP ? body->oa.o_gr : (__u64)0, - pp_rnb[0].offset, - pp_rnb[npages-1].offset+pp_rnb[npages-1].len-1); + pp_rnb[0].offset, + pp_rnb[npages-1].offset+pp_rnb[npages-1].len + - 1 ); CERROR("client csum %x, original server csum %x, " "server csum now %x\n", client_cksum, server_cksum, new_cksum); diff --git a/lustre/ptlrpc/client.c b/lustre/ptlrpc/client.c index 4cfb3b9..d350ce0 100644 --- a/lustre/ptlrpc/client.c +++ b/lustre/ptlrpc/client.c @@ -570,11 +570,11 @@ static int ptlrpc_check_status(struct ptlrpc_request *req) err = lustre_msg_get_status(req->rq_repmsg); if (lustre_msg_get_type(req->rq_repmsg) == PTL_RPC_MSG_ERR) { - LCONSOLE_ERROR(0x011, "an error ocurred while communicating " - "with %s The %s operation failed with %d", - obd_export_nid2str(req->rq_export), - ll_opcode2str(lustre_msg_get_opc(req->rq_reqmsg)), - err); + LCONSOLE_ERROR_MSG(0x011, "an error ocurred while communicating" + " with %s The %s operation failed with %d", + obd_export_nid2str(req->rq_export), + ll_opcode2str(lustre_msg_get_opc(req->rq_reqmsg)), + err); RETURN(err < 0 ? err : -EINVAL); } diff --git a/lustre/ptlrpc/import.c b/lustre/ptlrpc/import.c index 3ccfdfd..089ade3 100644 --- a/lustre/ptlrpc/import.c +++ b/lustre/ptlrpc/import.c @@ -132,10 +132,10 @@ int ptlrpc_set_import_discon(struct obd_import *imp, __u32 conn_cnt) imp->imp_obd->obd_name, target_len, target_start, libcfs_nid2str(imp->imp_connection->c_peer.nid)); } else { - LCONSOLE_ERROR(0x166, "%s: Connection to service %.*s " - "via nid %s was lost; in progress operations " - "using this service will fail.\n", - imp->imp_obd->obd_name, target_len, target_start, + LCONSOLE_ERROR_MSG(0x166, "%s: Connection to service " + "%.*s via nid %s was lost; in progress " + "operations using this service will fail.\n", + imp->imp_obd->obd_name, target_len, target_start, libcfs_nid2str(imp->imp_connection->c_peer.nid)); } IMPORT_SET_STATE_NOLOCK(imp, LUSTRE_IMP_DISCON); @@ -759,7 +759,7 @@ finish: /* Actually servers are only supposed to refuse connection from liblustre clients, so we should never see this from VFS context */ - LCONSOLE_ERROR(0x16a, "Server %s version " + LCONSOLE_ERROR_MSG(0x16a, "Server %s version " "(%d.%d.%d.%d)" " refused connection from this client " "with an incompatible version (%s). " @@ -873,10 +873,10 @@ int ptlrpc_import_recovery_state_machine(struct obd_import *imp) /* Don't care about MGC eviction */ if (strcmp(imp->imp_obd->obd_type->typ_name, LUSTRE_MGC_NAME) != 0) { - LCONSOLE_ERROR(0x167, "This client was evicted by " - "%.*s; in progress operations using " - "this service will fail.\n", - target_len, target_start); + LCONSOLE_ERROR_MSG(0x167, "This client was evicted by " + "%.*s; in progress operations using " + "this service will fail.\n", + target_len, target_start); } CDEBUG(D_HA, "evicted from %s@%s; invalidating\n", obd2cli_tgt(imp->imp_obd), -- 1.8.3.1