Whamcloud - gitweb
This update includes Hex error ID's and checksum calculation for console error messages.
authorjitendra <jitendra>
Wed, 13 Jun 2007 07:28:47 +0000 (07:28 +0000)
committerjitendra <jitendra>
Wed, 13 Jun 2007 07:28:47 +0000 (07:28 +0000)
It also includes code fixes for first five improved error messages.

b=10595
i=adilger
i=braam

21 files changed:
lustre/ldlm/ldlm_lib.c
lustre/ldlm/ldlm_lockd.c
lustre/ldlm/ldlm_resource.c
lustre/liblustre/super.c
lustre/llite/llite_lib.c
lustre/lov/lov_qos.c
lustre/mds/mds_fs.c
lustre/mds/mds_reint.c
lustre/mgc/mgc_request.c
lustre/mgs/mgs_handler.c
lustre/mgs/mgs_llog.c
lustre/obdclass/genops.c
lustre/obdclass/obd_config.c
lustre/obdclass/obd_mount.c
lustre/obdfilter/filter.c
lustre/osc/osc_request.c
lustre/ost/ost_handler.c
lustre/ptlrpc/autoMakefile.am
lustre/ptlrpc/client.c
lustre/ptlrpc/import.c
lustre/ptlrpc/lproc_ptlrpc.c

index 29eb851..2844e8a 100644 (file)
@@ -578,7 +578,7 @@ 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("UUID '%s' is not available "
+                LCONSOLE_ERROR(0x137, "UUID '%s' is not available "
                                " for connect (%s)\n", str,
                                !target ? "no target" :
                                (target->obd_stopping ? "stopping" :
index 9f2b1d5..0d355e5 100644 (file)
@@ -419,13 +419,11 @@ 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("A client on nid %s was evicted from service %s.\n",
-                       str, lock->l_export->exp_obd->obd_name);
+        LCONSOLE_ERROR(0x138, "A client on nid %s was evicted from "
+                 "service %s.\n", str, lock->l_export->exp_obd->obd_name);
 
-        LDLM_ERROR(lock, "%s AST failed (%d): evicting client %s@%s NID %s"
-                   " (%s)", ast_type, rc, lock->l_export->exp_client_uuid.uuid,
-                   conn->c_remote_uuid.uuid, libcfs_nid2str(conn->c_peer.nid),
-                   str);
+        LCONSOLE_ERROR(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();
index 8362688..1687299 100644 (file)
@@ -431,12 +431,12 @@ 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("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(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);
         }
index 64fa37a..cdd85e9 100644 (file)
@@ -1477,8 +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) {
-                        CERROR("liblustre don't support O_NONBLOCK, O_ASYNC, "
-                               "and O_DIRECT on file descriptor\n");
+                        LCONSOLE_ERROR(0x010, "liblustre does not support "
+                                      "the O_NONBLOCK or O_ASYNC flags. "
+                                      "Please fix your application.\n");
                         *rtn = -EINVAL;
                         err = EINVAL;
                         break;
index 7d5fe8e..a71c086 100644 (file)
@@ -180,9 +180,9 @@ 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("An MDT (mdc %s) is performing recovery, of "
-                               "which this client is not a part.  Please wait "
-                               "for recovery to complete, abort, or "
+                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);
                 GOTO(out, err);
         } else if (err) {
@@ -268,9 +268,9 @@ 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("An OST (osc %s) is performing recovery, of "
-                               "which this client is not a part.  Please wait "
-                               "for recovery to complete, abort, or "
+                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);
                 GOTO(out, err);
         } else if (err) {
@@ -287,7 +287,7 @@ 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("There are no OST's in this filesystem. "
+                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");
                 GOTO(out_osc, err);
@@ -668,7 +668,8 @@ static int ll_options(char *options, int *flags)
                         goto next;
                 }
 
-                LCONSOLE_ERROR("Unknown option '%s', won't mount.\n", s1);
+                LCONSOLE_ERROR(0x152, "Unknown option '%s', won't mount.\n",
+                               s1);
                 RETURN(-EINVAL);
 
 next:
@@ -765,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("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(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);
         }
 
@@ -838,18 +839,18 @@ static int old_lustre_process_log(struct super_block *sb, char *newprofile,
                 break;
         }
         case -EINVAL:
-                LCONSOLE_ERROR("%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",
+                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);
                 /* fall through */
         default:
-                LCONSOLE_ERROR("%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(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;
         }
 
@@ -955,9 +956,9 @@ int ll_fill_super(struct super_block *sb)
 
         lprof = class_get_profile(profilenm);
         if (lprof == NULL) {
-                LCONSOLE_ERROR("The client profile '%s' could not be read "
-                               "from the MGS.  Does that filesystem exist?\n",
-                               profilenm);
+                LCONSOLE_ERROR(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, 
index 8bcc7e2..17e8822 100644 (file)
@@ -379,8 +379,9 @@ static int qos_calc_rr(struct lov_obd *lov)
 
         if (placed != real_count) {
                 /* This should never happen */
-                LCONSOLE_ERROR("Failed to place all OSTs in the round-robin "
-                               "list (%d of %d).\n", placed, real_count);
+                LCONSOLE_ERROR(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]);
index f79285d..043caf9 100644 (file)
@@ -297,9 +297,9 @@ 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("Trying to start OBD %s using the wrong"
-                                       " disk %s. Were the /dev/ assignments "
-                                       "rearranged?\n",
+                        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);
                         GOTO(err_msd, rc = -EINVAL);
                 }
index 503d2b7..f4e3753 100644 (file)
@@ -1992,7 +1992,7 @@ int mds_get_parents_children_locked(struct obd_device *obd,
         *de_oldp = ll_lookup_one_len(old_name, *de_srcdirp, old_len - 1);
         if (IS_ERR(*de_oldp)) {
                 rc = PTR_ERR(*de_oldp);
-                CERROR("old child lookup error (%.*s): %d\n",
+                CDEBUG(D_INODE, "old child lookup error (%.*s): %d\n",
                        old_len - 1, old_name, rc);
                 GOTO(cleanup, rc);
         }
index 8756885..20c7b97 100644 (file)
@@ -1073,8 +1073,8 @@ 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("Failed to get MGS log %s "
-                                               "and no local copy.\n",
+                                LCONSOLE_ERROR(0x13a, "Failed to get MGS "
+                                               "log %s and no local copy.\n",
                                                cld->cld_logname);
                                 GOTO(out_pop, rc = -ENOTCONN);
                         }
index b53339a..cd941f2 100644 (file)
@@ -322,13 +322,13 @@ 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("%s claims to have registered, but this MGS "
-                               "does not know about it.  Assuming writeconf.\n",
-                               mti->mti_svname);
+                LCONSOLE_ERROR(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("Client log %s-client has disappeared! "
+                LCONSOLE_ERROR(0x13c, "Client log %s-client has disappeared! "
                                "Regenerating all logs.\n",
                                mti->mti_fsname);
                 mti->mti_flags |= LDD_F_WRITECONF;
@@ -375,7 +375,7 @@ 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("%s: Can't signal other nodes to update "
+                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",
index 0cb5b69..d20be98 100644 (file)
@@ -463,13 +463,13 @@ 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("MDT index must = 0 (until Clustered MetaData "
-                               "feature is ready.)\n");
+                LCONSOLE_ERROR(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("Server %s requested index %d, but the"
+                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);
@@ -478,8 +478,8 @@ int mgs_set_index(struct obd_device *obd, struct mgs_target_info *mti)
          
         if (test_bit(mti->mti_stripe_index, imap)) {
                 if (mti->mti_flags & LDD_F_VIRGIN) {
-                        LCONSOLE_ERROR("Server %s requested index %d, but that "
-                                       "index is already in use\n",
+                        LCONSOLE_ERROR(0x140, "Server %s requested index %d, "
+                                       "but that index is already in use\n",
                                        mti->mti_svname, mti->mti_stripe_index);
                         RETURN(-EADDRINUSE);
                 } else {
@@ -1203,11 +1203,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("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(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,7 +1287,7 @@ 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("The target %s has not registered yet. "
+                LCONSOLE_ERROR(0x142, "The target %s has not registered yet. "
                                "It must be started before failnids can "
                                "be added.\n", mti->mti_svname);
                 RETURN(-ENOENT);
@@ -1303,8 +1303,8 @@ 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("Failover NIDs cannot be added to "
-                                       "upgraded client logs for %s. Consider "
+                        LCONSOLE_ERROR(0x143, "Failover NIDs cannot be added to"
+                                       " upgraded client logs for %s. Consider "
                                        "updating the configuration with "
                                        "--writeconf.\n", 
                                        mti->mti_svname);
@@ -1457,8 +1457,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("%s: Only OSCs can be (de)activ"
-                                               "ated.\n", mti->mti_svname);
+                                LCONSOLE_ERROR(0x144, "%s: Only OSCs can be "
+                                               "(de)activated.\n", 
+                                               mti->mti_svname);
                                 rc = -EINVAL;
                                 goto end_while;
                         }
@@ -1479,13 +1480,15 @@ static int mgs_write_log_params(struct obd_device *obd, struct fs_db *fsdb,
                         name_destroy(&logname);
 active_err:
                         if (rc) {
-                                LCONSOLE_ERROR("Couldn't find %s in log (%d). "
-                                   "No permanent changes were made to the "
-                                   "config log.\n", mti->mti_svname, 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);
                                 if (fsdb->fsdb_flags & FSDB_OLDLOG14) 
-                                        LCONSOLE_ERROR("This may be because the"
-                                        " log is in the old 1.4 style. Consider"
-                                        " --writeconf to update the logs.\n");
+                                        LCONSOLE_ERROR(0x146, "This may be "
+                                        "because the log is in the old 1.4 "
+                                        "style. Consider --writeconf to "
+                                        "update the logs.\n");
                                 goto end_while;
                         }
                         /* Fall through to osc proc for deactivating 
@@ -1498,9 +1501,9 @@ 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("LOV params must be set on the "
-                                               "MDT, not %s. Ignoring.\n",
-                                               mti->mti_svname);
+                                LCONSOLE_ERROR(0x147, "LOV params must be set "
+                                               "on the MDT, not %s. "
+                                               "Ignoring.\n", mti->mti_svname);
                                 rc = 0;
                                 goto end_while;
                         }
@@ -1542,8 +1545,8 @@ active_err:
                         } else if (mti->mti_flags & LDD_F_SV_TYPE_OST) {
                                 /* COMPAT_146 */
                                 if (fsdb->fsdb_flags & FSDB_OLDLOG14) {
-                                      LCONSOLE_ERROR("Upgraded client logs "
-                                           "for %s cannot be modified. "
+                                      LCONSOLE_ERROR(0x148, "Upgraded client "
+                                           "logs for %s cannot be modified. "
                                            "Consider updating the "
                                            "configuration with --writeconf\n",
                                            mti->mti_svname);
@@ -1664,11 +1667,12 @@ int mgs_write_log_target(struct obd_device *obd,
                                       "upgrading\n", mti->mti_stripe_index, 
                                       mti->mti_svname);
                 } else {
-                        LCONSOLE_ERROR("Failed to find %s in the old client "
-                                       "log. Apparently it is not part of this "
-                                       "filesystem, or the old log is wrong.\n"
-                                       "Use 'writeconf' on the MDT to force log"
-                                       " regeneration.\n", mti->mti_svname);
+                        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);
                         /* Not in client log?  Upgrade anyhow...*/
                         /* Argument against upgrading: reformat MDT,
                            upgrade OST, then OST will start but will be SKIPped
@@ -1758,8 +1762,8 @@ 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("The old client log %s-client is missing.  Was "
-                               "tunefs.lustre successful?\n",
+                LCONSOLE_ERROR(0x14a, "The old client log %s-client is "
+                               "missing.  Was tunefs.lustre successful?\n",
                                mti->mti_fsname);
                 RETURN(-ENOENT);
         }
@@ -1772,8 +1776,8 @@ 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("The old MDT log %s is missing.  Was "
-                                       "tunefs.lustre successful?\n",
+                        LCONSOLE_ERROR(0x14b, "The old MDT log %s is missing. "
+                                       "Was tunefs.lustre successful?\n",
                                        mti->mti_svname);
                         RETURN(-ENOENT);
                 }
@@ -1791,10 +1795,10 @@ int mgs_upgrade_sv_14(struct obd_device *obd, struct mgs_target_info *mti)
         }
 
         if (!(fsdb->fsdb_flags & FSDB_OLDLOG14)) {
-                LCONSOLE_ERROR("%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(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);
@@ -1912,7 +1916,7 @@ int mgs_setparam(struct obd_device *obd, struct lustre_cfg *lcfg, char *fsname)
                 }
         }
         if (!devname) {
-                LCONSOLE_ERROR("No target specified: %s\n", param);
+                LCONSOLE_ERROR(0x14d, "No target specified: %s\n", param);
                 RETURN(-ENOSYS);
         }
 
index f9ebae6..2137f2f 100644 (file)
@@ -105,7 +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("Can't load module '%s'\n", modname);
+                        LCONSOLE_ERROR(0x158, "Can't load module '%s'\n",
+                                       modname);
                 }
         }
 #endif
index ca283d1..1d9f425 100644 (file)
@@ -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("Can't parse NID '%s'\n", buf);
+                LCONSOLE_ERROR(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("recovery upcall is deprecated\n");
+                LCONSOLE_ERROR(0x15a, "recovery upcall is deprecated\n");
                 /* COMPAT_146 Don't fail on old configs */
                 GOTO(out, err = 0);
         }
index 0dd655e..3a89bae 100644 (file)
@@ -362,15 +362,15 @@ int lustre_process_log(struct super_block *sb, char *logname,
         lustre_cfg_free(lcfg);
 
         if (rc == -EINVAL)
-                LCONSOLE_ERROR("%s: The configuration from log '%s' failed "
-                               "(%d). Make sure this client and "
+                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);
 
         if (rc)
-                LCONSOLE_ERROR("%s: The configuration from log '%s' failed "
-                               "(%d). This may be the result of "
+                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",
@@ -468,8 +468,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("The MGS service was already started from "
-                               "server %s\n", lsi->lsi_ldd->ldd_svname);
+                LCONSOLE_ERROR(0x15d, "The MGS service was already started "
+                               "from server %s\n", lsi->lsi_ldd->ldd_svname);
                 RETURN(-EALREADY);
         }
 
@@ -483,8 +483,8 @@ static int server_start_mgs(struct super_block *sb)
                 server_deregister_mount(LUSTRE_MGS_OBDNAME);
 
         if (rc)
-                LCONSOLE_ERROR("Failed to start MGS '%s' (%d).  Is the 'mgs' "
-                               "module loaded?\n", LUSTRE_MGS_OBDNAME, rc);
+                LCONSOLE_ERROR(0x15e, "Failed to start MGS '%s' (%d).  Is the "
+                         "'mgs' module loaded?\n", LUSTRE_MGS_OBDNAME, rc);
 
         RETURN(rc);
 }
@@ -1048,15 +1048,15 @@ 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("Communication error with the MGS.  Is "
-                                       "the MGS running?\n");
+                        LCONSOLE_ERROR(0x15f, "Communication error with the "
+                                       "MGS.  Is the MGS running?\n");
                 }
                 GOTO(out_mgc, 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);
+                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);
                 GOTO(out_mgc, rc);
         }
 
@@ -1539,8 +1539,8 @@ static int server_fill_super(struct super_block *sb)
                lsi->lsi_lmd->lmd_dev);
 
         if (class_name2obd(lsi->lsi_ldd->ldd_svname)) {
-                LCONSOLE_ERROR("The target named %s is already running. "
-                               "Double-mount may have compromised the disk "
+                LCONSOLE_ERROR(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);
@@ -1751,14 +1751,14 @@ static int lmd_parse(char *options, struct lustre_mount_data *lmd)
 
         LASSERT(lmd);
         if (!options) {
-                LCONSOLE_ERROR("Missing mount data: check that "
+                LCONSOLE_ERROR(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("You're using an old version of "
+                LCONSOLE_ERROR(0x163, "You're using an old version of "
                                "/sbin/mount.lustre.  Please install version "
                                "%s\n", LUSTRE_VERSION_STRING);
                 RETURN(-EINVAL);
@@ -1818,7 +1818,7 @@ static int lmd_parse(char *options, struct lustre_mount_data *lmd)
         }
 
         if (!devname) {
-                LCONSOLE_ERROR("Can't find the device name "
+                LCONSOLE_ERROR(0x164, "Can't find the device name "
                                "(need mount option 'device=...')\n");
                 goto invalid;
         }
@@ -1888,8 +1888,8 @@ 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("Nothing registered for client mount!"
-                               " Is the 'lustre' module loaded?\n");
+                        LCONSOLE_ERROR(0x165, "Nothing registered for client "
+                               "mount! Is the 'lustre' module loaded?\n");
                         rc = -ENODEV;
                 } else {
                         rc = lustre_start_mgc(sb);
index 0ea2ea7..cac36f0 100644 (file)
@@ -663,9 +663,9 @@ 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("Trying to start OBD %s using the wrong"
-                                       " disk %s. Were the /dev/ assignments "
-                                       "rearranged?\n",
+                        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);
                         GOTO(err_fsd, rc = -EINVAL);
                 }
@@ -1645,7 +1645,7 @@ 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("Can't mount disk %s (%d)\n",
+                        LCONSOLE_ERROR(0x135, "Can't mount disk %s (%d)\n",
                                        lustre_cfg_string(lcfg, 1), rc);
                         RETURN(rc);
                 }
@@ -1980,9 +1980,9 @@ 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("Connection from %s to index %u doesn't "
-                                       "match actual OST index %u in last_rcvd "
-                                       "file, bad configuration?\n",
+                        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);
                         RETURN(-EBADF);
index 4e0dd73..a0af12b 100644 (file)
@@ -1032,7 +1032,7 @@ 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("BAD WRITE CHECKSUM: %s: from %s inum "LPU64"/"LPU64
+        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,
@@ -1143,9 +1143,9 @@ 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("%s: BAD READ CHECKSUM: from %s%s%s inum "
-                                       LPU64"/"LPU64" object "LPU64"/"LPU64
-                                       " extent ["LPU64"-"LPU64"]\n",
+                        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,
index 85aed53..e6d67de 100644 (file)
@@ -1078,8 +1078,8 @@ static int ost_brw_write(struct ptlrpc_request *req, struct obd_trans_info *oti)
                         router = libcfs_nid2str(desc->bd_sender);
                 }
                 
-                LCONSOLE_ERROR("%s: BAD WRITE CHECKSUM: %s from %s%s%s inum "
-                               LPU64"/"LPU64" object "LPU64"/"LPU64
+                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),
index ca1231a..80f9c47 100644 (file)
@@ -17,7 +17,7 @@ LDLM_COMM_SOURCES= $(top_srcdir)/lustre/ldlm/l_lock.c \
 
 COMMON_SOURCES =  client.c recover.c connection.c niobuf.c pack_generic.c   \
     events.c ptlrpc_module.c service.c pinger.c recov_thread.c llog_net.c   \
-    llog_client.c llog_server.c import.c ptlrpcd.c pers.c wiretest.c               \
+    llog_client.c llog_server.c import.c ptlrpcd.c pers.c lproc_ptlrpc.c wiretest.c \
     ptlrpc_internal.h $(LDLM_COMM_SOURCES)
 
 if LIBLUSTRE
index b1ba7df..4cfb3b9 100644 (file)
@@ -570,8 +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) {
-                DEBUG_REQ(D_ERROR, req, "type == PTL_RPC_MSG_ERR, err == %d",
-                          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);
                 RETURN(err < 0 ? err : -EINVAL);
         }
 
index 6c32ce7..baf7058 100644 (file)
@@ -132,9 +132,9 @@ 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("%s: Connection to service %.*s via nid "
-                               "%s was lost; in progress operations using this "
-                               "service will fail.\n",
+                        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,
                                libcfs_nid2str(imp->imp_connection->c_peer.nid));
                 }
@@ -872,9 +872,9 @@ 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("This client was evicted by %.*s; "
-                                       "in progress operations using this "
-                                       "service will fail.\n",
+                        LCONSOLE_ERROR(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",
index 023bd07..fd4ee1a 100644 (file)
  */
 #define DEBUG_SUBSYSTEM S_CLASS
 
+#ifndef __KERNEL__
+# include <liblustre.h>
+#endif
+
 #include <obd_support.h>
 #include <obd.h>
 #include <lprocfs_status.h>