diff options
Diffstat (limited to 'drivers/staging/lustre/lustre/ptlrpc')
17 files changed, 181 insertions, 324 deletions
diff --git a/drivers/staging/lustre/lustre/ptlrpc/client.c b/drivers/staging/lustre/lustre/ptlrpc/client.c index 38cc931a189c..dc9e406f3212 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/client.c +++ b/drivers/staging/lustre/lustre/ptlrpc/client.c @@ -265,8 +265,7 @@ static void ptlrpc_at_adj_service(struct ptlrpc_request *req, so just keep minimal history here */ oldse = at_measured(&at->iat_service_estimate[idx], serv_est); if (oldse != 0) - CDEBUG(D_ADAPTTO, "The RPC service estimate for %s ptl %d " - "has changed from %d to %d\n", + CDEBUG(D_ADAPTTO, "The RPC service estimate for %s ptl %d has changed from %d to %d\n", req->rq_import->imp_obd->obd_name, req->rq_request_portal, oldse, at_get(&at->iat_service_estimate[idx])); } @@ -297,8 +296,7 @@ static void ptlrpc_at_adj_net_latency(struct ptlrpc_request *req, oldnl = at_measured(&at->iat_net_latency, nl); if (oldnl != 0) - CDEBUG(D_ADAPTTO, "The network latency for %s (nid %s) " - "has changed from %d to %d\n", + CDEBUG(D_ADAPTTO, "The network latency for %s (nid %s) has changed from %d to %d\n", req->rq_import->imp_obd->obd_name, obd_uuid2str( &req->rq_import->imp_connection->c_remote_uuid), @@ -371,8 +369,8 @@ static int ptlrpc_at_recv_early_reply(struct ptlrpc_request *req) ptlrpc_at_get_net_latency(req); DEBUG_REQ(D_ADAPTTO, req, - "Early reply #%d, new deadline in "CFS_DURATION_T"s " - "("CFS_DURATION_T"s)", req->rq_early_count, + "Early reply #%d, new deadline in " CFS_DURATION_T "s (" CFS_DURATION_T "s)", + req->rq_early_count, cfs_time_sub(req->rq_deadline, get_seconds()), cfs_time_sub(req->rq_deadline, olddl)); @@ -445,8 +443,8 @@ void ptlrpc_add_rqs_to_pool(struct ptlrpc_request_pool *pool, int num_rq) LASSERTF(list_empty(&pool->prp_req_list) || size == pool->prp_rq_size, - "Trying to change pool size with nonempty pool " - "from %d to %d bytes\n", pool->prp_rq_size, size); + "Trying to change pool size with nonempty pool from %d to %d bytes\n", + pool->prp_rq_size, size); spin_lock(&pool->prp_lock); pool->prp_rq_size = size; @@ -1146,11 +1144,10 @@ static int ptlrpc_check_status(struct ptlrpc_request *req) struct obd_import *imp = req->rq_import; __u32 opc = lustre_msg_get_opc(req->rq_reqmsg); if (ptlrpc_console_allow(req)) - LCONSOLE_ERROR_MSG(0x011, "%s: Communicating with %s," - " operation %s failed with %d.\n", + LCONSOLE_ERROR_MSG(0x011, "%s: Communicating with %s, operation %s failed with %d.\n", imp->imp_obd->obd_name, libcfs_nid2str( - imp->imp_connection->c_peer.nid), + imp->imp_connection->c_peer.nid), ll_opcode2str(opc), err); return err < 0 ? err : -EINVAL; } @@ -1206,8 +1203,7 @@ static int after_reply(struct ptlrpc_request *req) if (req->rq_reply_truncate) { if (ptlrpc_no_resend(req)) { - DEBUG_REQ(D_ERROR, req, "reply buffer overflow," - " expected: %d, actual size: %d", + DEBUG_REQ(D_ERROR, req, "reply buffer overflow, expected: %d, actual size: %d", req->rq_nob_received, req->rq_repbuf_len); return -EOVERFLOW; } @@ -1259,8 +1255,7 @@ static int after_reply(struct ptlrpc_request *req) /* new xid is already allocated for bulk in * ptlrpc_check_set() */ req->rq_xid = ptlrpc_next_xid(); - DEBUG_REQ(D_RPCTRACE, req, "Allocating new xid for " - "resend on EINPROGRESS"); + DEBUG_REQ(D_RPCTRACE, req, "Allocating new xid for resend on EINPROGRESS"); } /* Readjust the timeout for current conditions */ @@ -1412,8 +1407,8 @@ static int ptlrpc_send_new_req(struct ptlrpc_request *req) req->rq_waiting = 1; spin_unlock(&req->rq_lock); - DEBUG_REQ(D_HA, req, "req from PID %d waiting for recovery: " - "(%s != %s)", lustre_msg_get_status(req->rq_reqmsg), + DEBUG_REQ(D_HA, req, "req from PID %d waiting for recovery: (%s != %s)", + lustre_msg_get_status(req->rq_reqmsg), ptlrpc_import_state_name(req->rq_send_state), ptlrpc_import_state_name(imp->imp_state)); LASSERT(list_empty(&req->rq_list)); @@ -1450,8 +1445,8 @@ static int ptlrpc_send_new_req(struct ptlrpc_request *req) } } - CDEBUG(D_RPCTRACE, "Sending RPC pname:cluuid:pid:xid:nid:opc" - " %s:%s:%d:%llu:%s:%d\n", current_comm(), + CDEBUG(D_RPCTRACE, "Sending RPC pname:cluuid:pid:xid:nid:opc %s:%s:%d:%llu:%s:%d\n", + current_comm(), imp->imp_obd->obd_uuid.uuid, lustre_msg_get_status(req->rq_reqmsg), req->rq_xid, libcfs_nid2str(imp->imp_connection->c_peer.nid), @@ -1828,12 +1823,11 @@ interpret: ptlrpc_rqphase_move(req, RQ_PHASE_COMPLETE); CDEBUG(req->rq_reqmsg != NULL ? D_RPCTRACE : 0, - "Completed RPC pname:cluuid:pid:xid:nid:" - "opc %s:%s:%d:%llu:%s:%d\n", - current_comm(), imp->imp_obd->obd_uuid.uuid, - lustre_msg_get_status(req->rq_reqmsg), req->rq_xid, - libcfs_nid2str(imp->imp_connection->c_peer.nid), - lustre_msg_get_opc(req->rq_reqmsg)); + "Completed RPC pname:cluuid:pid:xid:nid:opc %s:%s:%d:%llu:%s:%d\n", + current_comm(), imp->imp_obd->obd_uuid.uuid, + lustre_msg_get_status(req->rq_reqmsg), req->rq_xid, + libcfs_nid2str(imp->imp_connection->c_peer.nid), + lustre_msg_get_opc(req->rq_reqmsg)); spin_lock(&imp->imp_lock); /* Request already may be not on sending or delaying list. This @@ -2215,10 +2209,8 @@ EXPORT_SYMBOL(ptlrpc_set_wait); */ static void __ptlrpc_free_req(struct ptlrpc_request *request, int locked) { - if (request == NULL) { + if (request == NULL) return; - } - LASSERTF(!request->rq_receiving_reply, "req %p\n", request); LASSERTF(request->rq_rqbd == NULL, "req %p\n", request);/* client-side */ LASSERTF(list_empty(&request->rq_list), "req %p\n", request); diff --git a/drivers/staging/lustre/lustre/ptlrpc/events.c b/drivers/staging/lustre/lustre/ptlrpc/events.c index 32dfffa76a5e..7f8644e01112 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/events.c +++ b/drivers/staging/lustre/lustre/ptlrpc/events.c @@ -128,8 +128,8 @@ void reply_in_callback(lnet_event_t *ev) ((lustre_msghdr_get_flags(req->rq_reqmsg) & MSGHDR_AT_SUPPORT))) { /* Early reply */ DEBUG_REQ(D_ADAPTTO, req, - "Early reply received: mlen=%u offset=%d replen=%d " - "replied=%d unlinked=%d", ev->mlength, ev->offset, + "Early reply received: mlen=%u offset=%d replen=%d replied=%d unlinked=%d", + ev->mlength, ev->offset, req->rq_replen, req->rq_replied, ev->unlinked); req->rq_early_count++; /* number received, client side */ @@ -313,8 +313,7 @@ void request_in_callback(lnet_event_t *ev) } req = ptlrpc_request_cache_alloc(GFP_ATOMIC); if (req == NULL) { - CERROR("Can't allocate incoming request descriptor: " - "Dropping %s RPC from %s\n", + CERROR("Can't allocate incoming request descriptor: Dropping %s RPC from %s\n", service->srv_name, libcfs_id2str(ev->initiator)); return; diff --git a/drivers/staging/lustre/lustre/ptlrpc/import.c b/drivers/staging/lustre/lustre/ptlrpc/import.c index 2e7e7171ca63..4ceb90db02a3 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/import.c +++ b/drivers/staging/lustre/lustre/ptlrpc/import.c @@ -157,18 +157,14 @@ int ptlrpc_set_import_discon(struct obd_import *imp, __u32 conn_cnt) &target_start, &target_len); if (imp->imp_replayable) { - LCONSOLE_WARN("%s: Connection to %.*s (at %s) was " - "lost; in progress operations using this " - "service will wait for recovery to complete\n", - imp->imp_obd->obd_name, target_len, target_start, - libcfs_nid2str(imp->imp_connection->c_peer.nid)); + LCONSOLE_WARN("%s: Connection to %.*s (at %s) was lost; in progress operations using this service will wait for recovery to complete\n", + imp->imp_obd->obd_name, target_len, target_start, + libcfs_nid2str(imp->imp_connection->c_peer.nid)); } else { - LCONSOLE_ERROR_MSG(0x166, "%s: Connection to " - "%.*s (at %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)); + LCONSOLE_ERROR_MSG(0x166, "%s: Connection to %.*s (at %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); spin_unlock(&imp->imp_lock); @@ -328,8 +324,8 @@ void ptlrpc_invalidate_import(struct obd_import *imp) * sluggish nets). Let's check this. If there * is no inflight and unregistering != 0, this * is bug. */ - LASSERTF(count == 0, "Some RPCs are still " - "unregistering: %d\n", count); + LASSERTF(count == 0, "Some RPCs are still unregistering: %d\n", + count); /* Let's save one loop as soon as inflight have * dropped to zero. No new inflights possible at @@ -353,12 +349,11 @@ void ptlrpc_invalidate_import(struct obd_import *imp) "still on delayed list"); } - CERROR("%s: RPCs in \"%s\" phase found (%d). " - "Network is sluggish? Waiting them " - "to error out.\n", cli_tgt, + CERROR("%s: RPCs in \"%s\" phase found (%d). Network is sluggish? Waiting them to error out.\n", + cli_tgt, ptlrpc_phase2str(RQ_PHASE_UNREGISTERING), atomic_read(&imp-> - imp_unregistering)); + imp_unregistering)); } spin_unlock(&imp->imp_lock); } @@ -413,8 +408,7 @@ void ptlrpc_fail_import(struct obd_import *imp, __u32 conn_cnt) if (ptlrpc_set_import_discon(imp, conn_cnt)) { if (!imp->imp_replayable) { - CDEBUG(D_HA, "import %s@%s for %s not replayable, " - "auto-deactivating\n", + CDEBUG(D_HA, "import %s@%s for %s not replayable, auto-deactivating\n", obd2cli_tgt(imp->imp_obd), imp->imp_connection->c_remote_uuid.uuid, imp->imp_obd->obd_name); @@ -541,8 +535,8 @@ static int import_select_connection(struct obd_import *imp) at_reset(at, CONNECTION_SWITCH_MAX); } LASSERT(imp_conn->oic_last_attempt); - CDEBUG(D_HA, "%s: tried all connections, increasing latency " - "to %ds\n", imp->imp_obd->obd_name, at_get(at)); + CDEBUG(D_HA, "%s: tried all connections, increasing latency to %ds\n", + imp->imp_obd->obd_name, at_get(at)); } imp_conn->oic_last_attempt = cfs_time_current_64(); @@ -564,8 +558,7 @@ static int import_select_connection(struct obd_import *imp) deuuidify(obd2cli_tgt(imp->imp_obd), NULL, &target_start, &target_len); - CDEBUG(D_HA, "%s: Connection changing to" - " %.*s (at %s)\n", + CDEBUG(D_HA, "%s: Connection changing to %.*s (at %s)\n", imp->imp_obd->obd_name, target_len, target_start, libcfs_nid2str(imp_conn->oic_conn->c_peer.nid)); @@ -935,14 +928,13 @@ static int ptlrpc_connect_interpret(const struct lu_env *env, lustre_msg_get_handle( request->rq_repmsg)->cookie); } else { - LCONSOLE_WARN("Evicted from %s (at %s) " - "after server handle changed from %#llx to %#llx\n", + LCONSOLE_WARN("Evicted from %s (at %s) after server handle changed from %#llx to %#llx\n", obd2cli_tgt(imp->imp_obd), imp->imp_connection-> \ c_remote_uuid.uuid, imp->imp_remote_handle.cookie, lustre_msg_get_handle( - request->rq_repmsg)->cookie); + request->rq_repmsg)->cookie); } @@ -962,8 +954,8 @@ static int ptlrpc_connect_interpret(const struct lu_env *env, } if (imp->imp_invalid) { - CDEBUG(D_HA, "%s: reconnected but import is invalid; " - "marking evicted\n", imp->imp_obd->obd_name); + CDEBUG(D_HA, "%s: reconnected but import is invalid; marking evicted\n", + imp->imp_obd->obd_name); IMPORT_SET_STATE(imp, LUSTRE_IMP_EVICTED); } else if (MSG_CONNECT_RECOVERING & msg_flags) { CDEBUG(D_HA, "%s: reconnected to %s during replay\n", @@ -985,8 +977,8 @@ static int ptlrpc_connect_interpret(const struct lu_env *env, imp->imp_last_replay_transno = 0; IMPORT_SET_STATE(imp, LUSTRE_IMP_REPLAY); } else { - DEBUG_REQ(D_HA, request, "%s: evicting (reconnect/recover flags" - " not set: %x)", imp->imp_obd->obd_name, msg_flags); + DEBUG_REQ(D_HA, request, "%s: evicting (reconnect/recover flags not set: %x)", + imp->imp_obd->obd_name, msg_flags); imp->imp_remote_handle = *lustre_msg_get_handle(request->rq_repmsg); IMPORT_SET_STATE(imp, LUSTRE_IMP_EVICTED); @@ -994,17 +986,13 @@ static int ptlrpc_connect_interpret(const struct lu_env *env, /* Sanity checks for a reconnected import. */ if (!(imp->imp_replayable) != !(msg_flags & MSG_CONNECT_REPLAYABLE)) { - CERROR("imp_replayable flag does not match server " - "after reconnect. We should LBUG right here.\n"); + CERROR("imp_replayable flag does not match server after reconnect. We should LBUG right here.\n"); } if (lustre_msg_get_last_committed(request->rq_repmsg) > 0 && lustre_msg_get_last_committed(request->rq_repmsg) < aa->pcaa_peer_committed) { - CERROR("%s went back in time (transno %lld" - " was previously committed, server now claims %lld" - ")! See https://bugzilla.lustre.org/show_bug.cgi?" - "id=9646\n", + CERROR("%s went back in time (transno %lld was previously committed, server now claims %lld)! See https://bugzilla.lustre.org/show_bug.cgi?id=9646\n", obd2cli_tgt(imp->imp_obd), aa->pcaa_peer_committed, lustre_msg_get_last_committed(request->rq_repmsg)); } @@ -1013,8 +1001,7 @@ finish: rc = ptlrpc_import_recovery_state_machine(imp); if (rc != 0) { if (rc == -ENOTCONN) { - CDEBUG(D_HA, "evicted/aborted by %s@%s during recovery;" - "invalidating and reconnecting\n", + CDEBUG(D_HA, "evicted/aborted by %s@%s during recovery; invalidating and reconnecting\n", obd2cli_tgt(imp->imp_obd), imp->imp_connection->c_remote_uuid.uuid); ptlrpc_connect_import(imp); @@ -1034,9 +1021,7 @@ finish: if ((imp->imp_connect_flags_orig & OBD_CONNECT_IBITS) && !(ocd->ocd_connect_flags & OBD_CONNECT_IBITS)) { - LCONSOLE_WARN("%s: MDS %s does not support ibits " - "lock, either very old or invalid: " - "requested %llx, replied %llx\n", + LCONSOLE_WARN("%s: MDS %s does not support ibits lock, either very old or invalid: requested %llx, replied %llx\n", imp->imp_obd->obd_name, imp->imp_connection->c_remote_uuid.uuid, imp->imp_connect_flags_orig, @@ -1052,13 +1037,12 @@ finish: LUSTRE_VERSION_OFFSET_WARN)) { /* Sigh, some compilers do not like #ifdef in the middle of macro arguments */ - const char *older = "older. Consider upgrading server " - "or downgrading client"; - const char *newer = "newer than client version. " - "Consider upgrading client"; + const char *older = "older. Consider upgrading server or downgrading client" + ; + const char *newer = "newer than client version. Consider upgrading client" + ; - LCONSOLE_WARN("Server %s version (%d.%d.%d.%d) " - "is much %s (%s)\n", + LCONSOLE_WARN("Server %s version (%d.%d.%d.%d) is much %s (%s)\n", obd2cli_tgt(imp->imp_obd), OBD_OCD_VERSION_MAJOR(ocd->ocd_version), OBD_OCD_VERSION_MINOR(ocd->ocd_version), @@ -1095,10 +1079,7 @@ finish: * the checksum types it doesn't support */ if ((ocd->ocd_cksum_types & cksum_types_supported_client()) == 0) { - LCONSOLE_WARN("The negotiation of the checksum " - "algorithm to use with server %s " - "failed (%x/%x), disabling " - "checksums\n", + LCONSOLE_WARN("The negotiation of the checksum algorithm to use with server %s failed (%x/%x), disabling checksums\n", obd2cli_tgt(imp->imp_obd), ocd->ocd_cksum_types, cksum_types_supported_client()); @@ -1191,17 +1172,13 @@ out: * connection from liblustre clients, so we * should never see this from VFS context */ - LCONSOLE_ERROR_MSG(0x16a, "Server %s version " - "(%d.%d.%d.%d)" - " refused connection from this client " - "with an incompatible version (%s). " - "Client must be recompiled\n", - obd2cli_tgt(imp->imp_obd), - OBD_OCD_VERSION_MAJOR(ocd->ocd_version), - OBD_OCD_VERSION_MINOR(ocd->ocd_version), - OBD_OCD_VERSION_PATCH(ocd->ocd_version), - OBD_OCD_VERSION_FIX(ocd->ocd_version), - LUSTRE_VERSION_STRING); + LCONSOLE_ERROR_MSG(0x16a, "Server %s version (%d.%d.%d.%d) refused connection from this client with an incompatible version (%s). Client must be recompiled\n", + obd2cli_tgt(imp->imp_obd), + OBD_OCD_VERSION_MAJOR(ocd->ocd_version), + OBD_OCD_VERSION_MINOR(ocd->ocd_version), + OBD_OCD_VERSION_PATCH(ocd->ocd_version), + OBD_OCD_VERSION_FIX(ocd->ocd_version), + LUSTRE_VERSION_STRING); ptlrpc_deactivate_import(imp); IMPORT_SET_STATE(imp, LUSTRE_IMP_CLOSED); } @@ -1237,8 +1214,7 @@ static int completed_replay_interpret(const struct lu_env *env, "%s: version recovery fails, reconnecting\n", req->rq_import->imp_obd->obd_name); } else { - CDEBUG(D_HA, "%s: LAST_REPLAY message error: %d, " - "reconnecting\n", + CDEBUG(D_HA, "%s: LAST_REPLAY message error: %d, reconnecting\n", req->rq_import->imp_obd->obd_name, req->rq_status); } @@ -1343,9 +1319,7 @@ 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_MSG(0x167, "%s: This client was evicted " - "by %.*s; in progress operations " - "using this service will fail.\n", + LCONSOLE_ERROR_MSG(0x167, "%s: This client was evicted by %.*s; in progress operations using this service will fail.\n", imp->imp_obd->obd_name, target_len, target_start); } @@ -1455,8 +1429,7 @@ int ptlrpc_disconnect_import(struct obd_import *imp, int noclose) break; default: rc = -EINVAL; - CERROR("%s: don't know how to disconnect from %s " - "(connect_op %d): rc = %d\n", + CERROR("%s: don't know how to disconnect from %s (connect_op %d): rc = %d\n", imp->imp_obd->obd_name, obd2cli_tgt(imp->imp_obd), imp->imp_connect_op, rc); return rc; @@ -1607,8 +1580,8 @@ int at_measured(struct adaptive_timeout *at, unsigned int val) at->at_current = max(at->at_current, at_min); if (at->at_current != old) - CDEBUG(D_OTHER, "AT %p change: old=%u new=%u delta=%d " - "(val=%u) hist %u %u %u %u\n", at, + CDEBUG(D_OTHER, "AT %p change: old=%u new=%u delta=%d (val=%u) hist %u %u %u %u\n", + at, old, at->at_current, at->at_current - old, val, at->at_hist[0], at->at_hist[1], at->at_hist[2], at->at_hist[3]); diff --git a/drivers/staging/lustre/lustre/ptlrpc/layout.c b/drivers/staging/lustre/lustre/ptlrpc/layout.c index 5b8337187b59..dc5ceb55d001 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/layout.c +++ b/drivers/staging/lustre/lustre/ptlrpc/layout.c @@ -980,18 +980,7 @@ EXPORT_SYMBOL(RMF_CONN); struct req_msg_field RMF_CONNECT_DATA = DEFINE_MSGF("cdata", RMF_F_NO_SIZE_CHECK /* we allow extra space for interop */, -#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 7, 50, 0) sizeof(struct obd_connect_data), -#else -/* For interoperability with 1.8 and 2.0 clients/servers. - * The RPC verification code allows larger RPC buffers, but not - * smaller buffers. Until we no longer need to keep compatibility - * with older servers/clients we can only check that the buffer - * size is at least as large as obd_connect_data_v1. That is not - * not in itself harmful, since the chance of just corrupting this - * field is low. See JIRA LU-16 for details. */ - sizeof(struct obd_connect_data_v1), -#endif lustre_swab_connect, NULL); EXPORT_SYMBOL(RMF_CONNECT_DATA); @@ -1897,8 +1886,8 @@ swabber_dumper_helper(struct req_capsule *pill, swabber(value); ptlrpc_buf_set_swabbed(pill->rc_req, inout, offset); if (dump) { - CDEBUG(D_RPCTRACE, "Dump of swabbed field %s " - "follows\n", field->rmf_name); + CDEBUG(D_RPCTRACE, "Dump of swabbed field %s follows\n", + field->rmf_name); field->rmf_dumper(value); } @@ -1914,8 +1903,7 @@ swabber_dumper_helper(struct req_capsule *pill, i < n; i++, p += field->rmf_size) { if (dump) { - CDEBUG(D_RPCTRACE, "Dump of %sarray field %s, " - "element %d follows\n", + CDEBUG(D_RPCTRACE, "Dump of %sarray field %s, element %d follows\n", do_swab ? "unswabbed " : "", field->rmf_name, i); field->rmf_dumper(p); } @@ -1923,8 +1911,8 @@ swabber_dumper_helper(struct req_capsule *pill, continue; swabber(p); if (dump) { - CDEBUG(D_RPCTRACE, "Dump of swabbed array field %s, " - "element %d follows\n", field->rmf_name, i); + CDEBUG(D_RPCTRACE, "Dump of swabbed array field %s, element %d follows\n", + field->rmf_name, i); field->rmf_dumper(value); } } @@ -1983,8 +1971,7 @@ static void *__req_capsule_get(struct req_capsule *pill, */ len = lustre_msg_buflen(msg, offset); if ((len % field->rmf_size) != 0) { - CERROR("%s: array field size mismatch " - "%d modulo %d != 0 (%d)\n", + CERROR("%s: array field size mismatch %d modulo %d != 0 (%d)\n", field->rmf_name, len, field->rmf_size, loc); return NULL; } @@ -1997,8 +1984,7 @@ static void *__req_capsule_get(struct req_capsule *pill, if (value == NULL) { DEBUG_REQ(D_ERROR, pill->rc_req, - "Wrong buffer for field `%s' (%d of %d) " - "in format `%s': %d vs. %d (%s)\n", + "Wrong buffer for field `%s' (%d of %d) in format `%s': %d vs. %d (%s)\n", field->rmf_name, offset, lustre_msg_bufcount(msg), fmt->rf_name, lustre_msg_buflen(msg, offset), len, rcl_names[loc]); @@ -2013,7 +1999,7 @@ static void *__req_capsule_get(struct req_capsule *pill, /** * Dump a request and/or reply */ -void __req_capsule_dump(struct req_capsule *pill, enum req_location loc) +static void __req_capsule_dump(struct req_capsule *pill, enum req_location loc) { const struct req_format *fmt; const struct req_msg_field *field; @@ -2031,8 +2017,8 @@ void __req_capsule_dump(struct req_capsule *pill, enum req_location loc) * have a specific dumper */ len = req_capsule_get_size(pill, field, loc); - CDEBUG(D_RPCTRACE, "Field %s has no dumper function;" - "field size is %d\n", field->rmf_name, len); + CDEBUG(D_RPCTRACE, "Field %s has no dumper function; field size is %d\n", + field->rmf_name, len); } else { /* It's the dumping side-effect that we're interested in */ (void) __req_capsule_get(pill, field, loc, NULL, 1); @@ -2184,8 +2170,7 @@ void req_capsule_set_size(struct req_capsule *pill, (size > 0)) { if ((field->rmf_flags & RMF_F_STRUCT_ARRAY) && (size % field->rmf_size != 0)) { - CERROR("%s: array field size mismatch " - "%d %% %d != 0 (%d)\n", + CERROR("%s: array field size mismatch %d %% %d != 0 (%d)\n", field->rmf_name, size, field->rmf_size, loc); LBUG(); } else if (!(field->rmf_flags & RMF_F_STRUCT_ARRAY) && diff --git a/drivers/staging/lustre/lustre/ptlrpc/llog_client.c b/drivers/staging/lustre/lustre/ptlrpc/llog_client.c index 56f825fbb17c..e9baf5bbee3a 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/llog_client.c +++ b/drivers/staging/lustre/lustre/ptlrpc/llog_client.c @@ -334,8 +334,7 @@ static int llog_client_read_header(const struct lu_env *env, llh_hdr->lrh_type, LLOG_HDR_MAGIC); rc = -EIO; } else if (llh_hdr->lrh_len != LLOG_CHUNK_SIZE) { - CERROR("incorrectly sized log header: %#x " - "(expecting %#x)\n", + CERROR("incorrectly sized log header: %#x (expecting %#x)\n", llh_hdr->lrh_len, LLOG_CHUNK_SIZE); CERROR("you may need to re-run lconf --write_conf.\n"); rc = -EIO; diff --git a/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c b/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c index 87b9764a4f19..4011e0050fcb 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c +++ b/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c @@ -175,7 +175,7 @@ const char *ll_opcode2str(__u32 opcode) return ll_rpc_opcode_table[offset].opname; } -const char* ll_eopcode2str(__u32 opcode) +const char *ll_eopcode2str(__u32 opcode) { LASSERT(ll_eopcode_table[opcode].opcode == opcode); return ll_eopcode_table[opcode].opname; @@ -694,8 +694,7 @@ default_queue: if (queue == PTLRPC_NRS_QUEUE_HP && !nrs_svc_has_hp(svc)) { rc = -ENODEV; goto out; - } - else if (queue == PTLRPC_NRS_QUEUE_BOTH && !nrs_svc_has_hp(svc)) + } else if (queue == PTLRPC_NRS_QUEUE_BOTH && !nrs_svc_has_hp(svc)) queue = PTLRPC_NRS_QUEUE_REG; /** @@ -746,8 +745,7 @@ ptlrpc_lprocfs_svc_req_history_seek(struct ptlrpc_service_part *svcpt, svcpt->scp_service->srv_name, svcpt->scp_cpt, srhi->srhi_seq, srhi->srhi_req->rq_history_seq); LASSERTF(!list_empty(&svcpt->scp_hist_reqs), - "%s:%d: seek offset %llu, request seq %llu, " - "last culled %llu\n", + "%s:%d: seek offset %llu, request seq %llu, last culled %llu\n", svcpt->scp_service->srv_name, svcpt->scp_cpt, seq, srhi->srhi_seq, svcpt->scp_hist_seq_culled); e = &srhi->srhi_req->rq_history_list; @@ -814,8 +812,8 @@ ptlrpc_lprocfs_svc_req_history_start(struct seq_file *s, loff_t *pos) int i; if (sizeof(loff_t) != sizeof(__u64)) { /* can't support */ - CWARN("Failed to read request history because size of loff_t " - "%d can't match size of u64\n", (int)sizeof(loff_t)); + CWARN("Failed to read request history because size of loff_t %d can't match size of u64\n", + (int)sizeof(loff_t)); return NULL; } @@ -1298,14 +1296,12 @@ int lprocfs_wr_import(struct file *file, const char *buffer, if (*endptr) { CERROR("config: wrong instance # %s\n", ptr); } else if (inst != imp->imp_connect_data.ocd_instance) { - CDEBUG(D_INFO, "IR: %s is connecting to an obsoleted " - "target(%u/%u), reconnecting...\n", + CDEBUG(D_INFO, "IR: %s is connecting to an obsoleted target(%u/%u), reconnecting...\n", imp->imp_obd->obd_name, imp->imp_connect_data.ocd_instance, inst); do_reconn = 1; } else { - CDEBUG(D_INFO, "IR: %s has already been connecting to " - "new target(%u)\n", + CDEBUG(D_INFO, "IR: %s has already been connecting to new target(%u)\n", imp->imp_obd->obd_name, inst); } } diff --git a/drivers/staging/lustre/lustre/ptlrpc/niobuf.c b/drivers/staging/lustre/lustre/ptlrpc/niobuf.c index c1e8aa4d5ec4..f715e9a8b996 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/niobuf.c +++ b/drivers/staging/lustre/lustre/ptlrpc/niobuf.c @@ -224,8 +224,8 @@ int ptlrpc_register_bulk(struct ptlrpc_request *req) total_md - desc->bd_md_count); spin_unlock(&desc->bd_lock); - CDEBUG(D_NET, "Setup %u bulk %s buffers: %u pages %u bytes, " - "xid x%#llx-%#llx, portal %u\n", desc->bd_md_count, + CDEBUG(D_NET, "Setup %u bulk %s buffers: %u pages %u bytes, xid x%#llx-%#llx, portal %u\n", + desc->bd_md_count, desc->bd_type == BULK_GET_SOURCE ? "get-source" : "put-sink", desc->bd_iov_count, desc->bd_nob, desc->bd_last_xid, req->rq_xid, desc->bd_portal); @@ -337,8 +337,7 @@ static void ptlrpc_at_set_reply(struct ptlrpc_request *req, int flags) if (req->rq_reqmsg && !(lustre_msghdr_get_flags(req->rq_reqmsg) & MSGHDR_AT_SUPPORT)) { - CDEBUG(D_ADAPTTO, "No early reply support: flags=%#x " - "req_flags=%#x magic=%d:%x/%x len=%d\n", + CDEBUG(D_ADAPTTO, "No early reply support: flags=%#x req_flags=%#x magic=%d:%x/%x len=%d\n", flags, lustre_msg_get_flags(req->rq_reqmsg), lustre_msg_is_v1(req->rq_reqmsg), lustre_msg_get_magic(req->rq_reqmsg), diff --git a/drivers/staging/lustre/lustre/ptlrpc/nrs.c b/drivers/staging/lustre/lustre/ptlrpc/nrs.c index 181301bd2083..d5fd7215c72f 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/nrs.c +++ b/drivers/staging/lustre/lustre/ptlrpc/nrs.c @@ -770,8 +770,8 @@ static int nrs_policy_register(struct ptlrpc_nrs *nrs, tmp = nrs_policy_find_locked(nrs, policy->pol_desc->pd_name); if (tmp != NULL) { - CERROR("NRS policy %s has been registered, can't register it " - "for %s\n", policy->pol_desc->pd_name, + CERROR("NRS policy %s has been registered, can't register it for %s\n", + policy->pol_desc->pd_name, svcpt->scp_service->srv_name); nrs_policy_put_locked(tmp); @@ -882,8 +882,7 @@ static int nrs_register_policies_locked(struct ptlrpc_nrs *nrs) if (nrs_policy_compatible(svc, desc)) { rc = nrs_policy_register(nrs, desc); if (rc != 0) { - CERROR("Failed to register NRS policy %s for " - "partition %d of service %s: %d\n", + CERROR("Failed to register NRS policy %s for partition %d of service %s: %d\n", desc->pd_name, svcpt->scp_cpt, svc->srv_name, rc); /** @@ -1082,8 +1081,7 @@ again: if (rc == -ENOENT) { rc = 0; } else if (rc != 0) { - CERROR("Failed to unregister NRS policy %s for " - "partition %d of service %s: %d\n", + CERROR("Failed to unregister NRS policy %s for partition %d of service %s: %d\n", desc->pd_name, svcpt->scp_cpt, svcpt->scp_service->srv_name, rc); return rc; @@ -1145,18 +1143,15 @@ int ptlrpc_nrs_policy_register(struct ptlrpc_nrs_pol_conf *conf) if ((conf->nc_flags & PTLRPC_NRS_FL_REG_EXTERN) && (conf->nc_flags & (PTLRPC_NRS_FL_FALLBACK | PTLRPC_NRS_FL_REG_START))) { - CERROR("NRS: failing to register policy %s. Please check " - "policy flags; external policies cannot act as fallback " - "policies, or be started immediately upon registration " - "without interaction with lprocfs\n", conf->nc_name); + CERROR("NRS: failing to register policy %s. Please check policy flags; external policies cannot act as fallback policies, or be started immediately upon registration without interaction with lprocfs\n", + conf->nc_name); return -EINVAL; } mutex_lock(&nrs_core.nrs_mutex); if (nrs_policy_find_desc_locked(conf->nc_name) != NULL) { - CERROR("NRS: failing to register policy %s which has already " - "been registered with NRS core!\n", + CERROR("NRS: failing to register policy %s which has already been registered with NRS core!\n", conf->nc_name); rc = -EEXIST; goto fail; @@ -1209,8 +1204,7 @@ again: nrs = nrs_svcpt2nrs(svcpt, hp); rc = nrs_policy_register(nrs, desc); if (rc != 0) { - CERROR("Failed to register NRS policy %s for " - "partition %d of service %s: %d\n", + CERROR("Failed to register NRS policy %s for partition %d of service %s: %d\n", desc->pd_name, svcpt->scp_cpt, svcpt->scp_service->srv_name, rc); @@ -1281,8 +1275,7 @@ int ptlrpc_nrs_policy_unregister(struct ptlrpc_nrs_pol_conf *conf) LASSERT(conf != NULL); if (conf->nc_flags & PTLRPC_NRS_FL_FALLBACK) { - CERROR("Unable to unregister a fallback policy, unless the " - "PTLRPC service is stopping.\n"); + CERROR("Unable to unregister a fallback policy, unless the PTLRPC service is stopping.\n"); return -EPERM; } @@ -1292,8 +1285,7 @@ int ptlrpc_nrs_policy_unregister(struct ptlrpc_nrs_pol_conf *conf) desc = nrs_policy_find_desc_locked(conf->nc_name); if (desc == NULL) { - CERROR("Failing to unregister NRS policy %s which has " - "not been registered with NRS core!\n", + CERROR("Failing to unregister NRS policy %s which has not been registered with NRS core!\n", conf->nc_name); rc = -ENOENT; goto not_exist; @@ -1304,9 +1296,8 @@ int ptlrpc_nrs_policy_unregister(struct ptlrpc_nrs_pol_conf *conf) rc = nrs_policy_unregister_locked(desc); if (rc < 0) { if (rc == -EBUSY) - CERROR("Please first stop policy %s on all service " - "partitions and then retry to unregister the " - "policy.\n", conf->nc_name); + CERROR("Please first stop policy %s on all service partitions and then retry to unregister the policy.\n", + conf->nc_name); goto fail; } diff --git a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c index 50556db15f79..2f45f7657830 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c +++ b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c @@ -412,8 +412,8 @@ void *lustre_msg_buf_v2(struct lustre_msg_v2 *m, int n, int min_size) buflen = m->lm_buflens[n]; if (unlikely(buflen < min_size)) { - CERROR("msg %p buffer[%d] size %d too small " - "(required %d, opc=%d)\n", m, n, buflen, min_size, + CERROR("msg %p buffer[%d] size %d too small (required %d, opc=%d)\n", + m, n, buflen, min_size, n == MSG_PTLRPC_BODY_OFF ? -1 : lustre_msg_get_opc(m)); return NULL; } @@ -749,21 +749,19 @@ char *lustre_msg_string(struct lustre_msg *m, int index, int max_len) slen = strnlen(str, blen); if (slen == blen) { /* not NULL terminated */ - CERROR("can't unpack non-NULL terminated string in " - "msg %p buffer[%d] len %d\n", m, index, blen); + CERROR("can't unpack non-NULL terminated string in msg %p buffer[%d] len %d\n", + m, index, blen); return NULL; } if (max_len == 0) { if (slen != blen - 1) { - CERROR("can't unpack short string in msg %p " - "buffer[%d] len %d: strlen %d\n", + CERROR("can't unpack short string in msg %p buffer[%d] len %d: strlen %d\n", m, index, blen, slen); return NULL; } } else if (slen > max_len) { - CERROR("can't unpack oversized string in msg %p " - "buffer[%d] len %d strlen %d: max %d expected\n", + CERROR("can't unpack oversized string in msg %p buffer[%d] len %d strlen %d: max %d expected\n", m, index, blen, slen, max_len); return NULL; } @@ -1313,43 +1311,17 @@ __u32 lustre_msg_get_cksum(struct lustre_msg *msg) } } -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 50, 0) -/* - * In 1.6 and 1.8 the checksum was computed only on struct ptlrpc_body as - * it was in 1.6 (88 bytes, smaller than the full size in 1.8). It makes - * more sense to compute the checksum on the full ptlrpc_body, regardless - * of what size it is, but in order to keep interoperability with 1.8 we - * can optionally also checksum only the first 88 bytes (caller decides). */ -# define ptlrpc_body_cksum_size_compat18 88 - -__u32 lustre_msg_calc_cksum(struct lustre_msg *msg, int compat18) -#else -# warning "remove checksum compatibility support for b1_8" __u32 lustre_msg_calc_cksum(struct lustre_msg *msg) -#endif { switch (msg->lm_magic) { case LUSTRE_MSG_MAGIC_V2: { struct ptlrpc_body *pb = lustre_msg_ptlrpc_body(msg); -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 50, 0) - __u32 crc; - unsigned int hsize = 4; - __u32 len = compat18 ? ptlrpc_body_cksum_size_compat18 : - lustre_msg_buflen(msg, MSG_PTLRPC_BODY_OFF); - LASSERTF(pb, "invalid msg %p: no ptlrpc body!\n", msg); - cfs_crypto_hash_digest(CFS_HASH_ALG_CRC32, (unsigned char *)pb, - len, NULL, 0, (unsigned char *)&crc, - &hsize); - return crc; -#else -# warning "remove checksum compatibility support for b1_8" __u32 crc; unsigned int hsize = 4; cfs_crypto_hash_digest(CFS_HASH_ALG_CRC32, (unsigned char *)pb, lustre_msg_buflen(msg, MSG_PTLRPC_BODY_OFF), NULL, 0, (unsigned char *)&crc, &hsize); return crc; -#endif } default: CERROR("incorrect message magic: %08x\n", msg->lm_magic); @@ -2284,8 +2256,8 @@ void lustre_swab_quota_body(struct quota_body *b) void dump_ioo(struct obd_ioobj *ioo) { CDEBUG(D_RPCTRACE, - "obd_ioobj: ioo_oid="DOSTID", ioo_max_brw=%#x, " - "ioo_bufct=%d\n", POSTID(&ioo->ioo_oid), ioo->ioo_max_brw, + "obd_ioobj: ioo_oid=" DOSTID ", ioo_max_brw=%#x, ioo_bufct=%d\n", + POSTID(&ioo->ioo_oid), ioo->ioo_max_brw, ioo->ioo_bufcnt); } EXPORT_SYMBOL(dump_ioo); @@ -2356,8 +2328,7 @@ void dump_obdo(struct obdo *oa) CDEBUG(D_RPCTRACE, "obdo: o_handle = %lld\n", oa->o_handle.cookie); if (valid & OBD_MD_FLCOOKIE) - CDEBUG(D_RPCTRACE, "obdo: o_lcookie = " - "(llog_cookie dumping not yet implemented)\n"); + CDEBUG(D_RPCTRACE, "obdo: o_lcookie = (llog_cookie dumping not yet implemented)\n"); } EXPORT_SYMBOL(dump_obdo); @@ -2421,17 +2392,15 @@ void _debug_req(struct ptlrpc_request *req, va_start(args, fmt); libcfs_debug_vmsg2(msgdata, fmt, args, - " req@%p x%llu/t%lld(%lld) o%d->%s@%s:%d/%d" - " lens %d/%d e %d to %d dl "CFS_TIME_T" ref %d " - "fl "REQ_FLAGS_FMT"/%x/%x rc %d/%d\n", + " req@%p x%llu/t%lld(%lld) o%d->%s@%s:%d/%d lens %d/%d e %d to %d dl " CFS_TIME_T " ref %d fl " REQ_FLAGS_FMT "/%x/%x rc %d/%d\n", req, req->rq_xid, req->rq_transno, req_ok ? lustre_msg_get_transno(req->rq_reqmsg) : 0, req_ok ? lustre_msg_get_opc(req->rq_reqmsg) : -1, req->rq_import ? - req->rq_import->imp_obd->obd_name : - req->rq_export ? - req->rq_export->exp_client_uuid.uuid : - "<?>", + req->rq_import->imp_obd->obd_name : + req->rq_export ? + req->rq_export->exp_client_uuid.uuid : + "<?>", libcfs_nid2str(nid), req->rq_request_portal, req->rq_reply_portal, req->rq_reqlen, req->rq_replen, diff --git a/drivers/staging/lustre/lustre/ptlrpc/pinger.c b/drivers/staging/lustre/lustre/ptlrpc/pinger.c index 20341b27a06a..340d98a64137 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/pinger.c +++ b/drivers/staging/lustre/lustre/ptlrpc/pinger.c @@ -206,8 +206,7 @@ static void ptlrpc_pinger_process_import(struct obd_import *imp, spin_unlock(&imp->imp_lock); - CDEBUG(level == LUSTRE_IMP_FULL ? D_INFO : D_HA, "%s->%s: level %s/%u " - "force %u force_next %u deactive %u pingable %u suppress %u\n", + CDEBUG(level == LUSTRE_IMP_FULL ? D_INFO : D_HA, "%s->%s: level %s/%u force %u force_next %u deactive %u pingable %u suppress %u\n", imp->imp_obd->obd_uuid.uuid, obd2cli_tgt(imp->imp_obd), ptlrpc_import_state_name(level), level, force, force_next, imp->imp_deactive, imp->imp_pingable, suppress); @@ -220,8 +219,7 @@ static void ptlrpc_pinger_process_import(struct obd_import *imp, } else if (level != LUSTRE_IMP_FULL || imp->imp_obd->obd_no_recov || imp_is_deactive(imp)) { - CDEBUG(D_HA, "%s->%s: not pinging (in recovery " - "or recovery disabled: %s)\n", + CDEBUG(D_HA, "%s->%s: not pinging (in recovery or recovery disabled: %s)\n", imp->imp_obd->obd_uuid.uuid, obd2cli_tgt(imp->imp_obd), ptlrpc_import_state_name(level)); if (force) { @@ -334,11 +332,7 @@ int ptlrpc_start_pinger(void) thread_is_running(&pinger_thread), &lwi); if (suppress_pings) - CWARN("Pings will be suppressed at the request of the " - "administrator. The configuration shall meet the " - "additional requirements described in the manual. " - "(Search for the \"suppress_pings\" kernel module " - "parameter.)\n"); + CWARN("Pings will be suppressed at the request of the administrator. The configuration shall meet the additional requirements described in the manual. (Search for the \"suppress_pings\" kernel module parameter.)\n"); return 0; } @@ -428,7 +422,7 @@ EXPORT_SYMBOL(ptlrpc_pinger_del_import); * Register a timeout callback to the pinger list, and the callback will * be called when timeout happens. */ -struct timeout_item* ptlrpc_new_timeout(int time, enum timeout_event event, +struct timeout_item *ptlrpc_new_timeout(int time, enum timeout_event event, timeout_cb_t cb, void *data) { struct timeout_item *ti; @@ -448,7 +442,7 @@ struct timeout_item* ptlrpc_new_timeout(int time, enum timeout_event event, } /** - * Register timeout event on the the pinger thread. + * Register timeout event on the pinger thread. * Note: the timeout list is an sorted list with increased timeout value. */ static struct timeout_item* @@ -623,11 +617,7 @@ static int ping_evictor_main(void *arg) if (expire_time > exp->exp_last_request_time) { class_export_get(exp); spin_unlock(&obd->obd_dev_lock); - LCONSOLE_WARN("%s: haven't heard from client %s" - " (at %s) in %ld seconds. I think" - " it's dead, and I am evicting" - " it. exp %p, cur %ld expire %ld" - " last %ld\n", + LCONSOLE_WARN("%s: haven't heard from client %s (at %s) in %ld seconds. I think it's dead, and I am evicting it. exp %p, cur %ld expire %ld last %ld\n", obd->obd_name, obd_uuid2str(&exp->exp_client_uuid), obd_export_nid2str(exp), diff --git a/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c b/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c index 357ea9f8bd57..cbcc541cac43 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c +++ b/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c @@ -356,10 +356,9 @@ static int ptlrpcd_check(struct lu_env *env, struct ptlrpcd_ctl *pc) if (atomic_read(&ps->set_new_count)) { rc = ptlrpcd_steal_rqset(set, ps); if (rc > 0) - CDEBUG(D_RPCTRACE, "transfer %d" - " async RPCs [%d->%d]\n", - rc, partner->pc_index, - pc->pc_index); + CDEBUG(D_RPCTRACE, "transfer %d async RPCs [%d->%d]\n", + rc, partner->pc_index, + pc->pc_index); } ptlrpc_reqset_put(ps); } while (rc == 0 && pc->pc_cursor != first); diff --git a/drivers/staging/lustre/lustre/ptlrpc/recover.c b/drivers/staging/lustre/lustre/ptlrpc/recover.c index e1bc77b83ffb..7b1d72947330 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/recover.c +++ b/drivers/staging/lustre/lustre/ptlrpc/recover.c @@ -237,8 +237,7 @@ void ptlrpc_request_handle_notconn(struct ptlrpc_request *failed_req) if (ptlrpc_set_import_discon(imp, lustre_msg_get_conn_cnt(failed_req->rq_reqmsg))) { if (!imp->imp_replayable) { - CDEBUG(D_HA, "import %s@%s for %s not replayable, " - "auto-deactivating\n", + CDEBUG(D_HA, "import %s@%s for %s not replayable, auto-deactivating\n", obd2cli_tgt(imp->imp_obd), imp->imp_connection->c_remote_uuid.uuid, imp->imp_obd->obd_name); @@ -274,8 +273,8 @@ int ptlrpc_set_import_active(struct obd_import *imp, int active) /* When deactivating, mark import invalid, and abort in-flight * requests. */ if (!active) { - LCONSOLE_WARN("setting import %s INACTIVE by administrator " - "request\n", obd2cli_tgt(imp->imp_obd)); + LCONSOLE_WARN("setting import %s INACTIVE by administrator request\n", + obd2cli_tgt(imp->imp_obd)); /* set before invalidate to avoid messages about imp_inval * set without imp_deactive in ptlrpc_import_delay_req */ diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec.c b/drivers/staging/lustre/lustre/ptlrpc/sec.c index 4ce76852e6ee..21e9dc9d5580 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec.c @@ -209,7 +209,7 @@ EXPORT_SYMBOL(sptlrpc_flavor2name_bulk); char *sptlrpc_flavor2name(struct sptlrpc_flavor *sf, char *buf, int bufsize) { - snprintf(buf, bufsize, "%s", sptlrpc_flavor2name_base(sf->sf_rpc)); + strlcpy(buf, sptlrpc_flavor2name_base(sf->sf_rpc), bufsize); /* * currently we don't support customized bulk specification for @@ -220,10 +220,9 @@ char *sptlrpc_flavor2name(struct sptlrpc_flavor *sf, char *buf, int bufsize) bspec[0] = '-'; sptlrpc_flavor2name_bulk(sf, &bspec[1], sizeof(bspec) - 1); - strncat(buf, bspec, bufsize); + strlcat(buf, bspec, bufsize); } - buf[bufsize - 1] = '\0'; return buf; } EXPORT_SYMBOL(sptlrpc_flavor2name); @@ -457,8 +456,8 @@ int sptlrpc_req_ctx_switch(struct ptlrpc_request *req, LASSERT(req->rq_reqlen); LASSERT(req->rq_replen); - CDEBUG(D_SEC, "req %p: switch ctx %p(%u->%s) -> %p(%u->%s), " - "switch sec %p(%s) -> %p(%s)\n", req, + CDEBUG(D_SEC, "req %p: switch ctx %p(%u->%s) -> %p(%u->%s), switch sec %p(%s) -> %p(%s)\n", + req, oldctx, oldctx->cc_vcred.vc_uid, sec2target_str(oldctx->cc_sec), newctx, newctx->cc_vcred.vc_uid, sec2target_str(newctx->cc_sec), oldctx->cc_sec, oldctx->cc_sec->ps_policy->sp_name, @@ -1842,8 +1841,8 @@ int sptlrpc_target_export_check(struct obd_export *exp, req->rq_svc_ctx, &flavor); } else { - CDEBUG(D_SEC, "exp %p (%x|%x|%x): is current flavor, " - "install rvs ctx\n", exp, exp->exp_flvr.sf_rpc, + CDEBUG(D_SEC, "exp %p (%x|%x|%x): is current flavor, install rvs ctx\n", + exp, exp->exp_flvr.sf_rpc, exp->exp_flvr_old[0].sf_rpc, exp->exp_flvr_old[1].sf_rpc); spin_unlock(&exp->exp_lock); @@ -1856,13 +1855,12 @@ int sptlrpc_target_export_check(struct obd_export *exp, if (exp->exp_flvr_expire[0]) { if (exp->exp_flvr_expire[0] >= get_seconds()) { if (flavor_allowed(&exp->exp_flvr_old[0], req)) { - CDEBUG(D_SEC, "exp %p (%x|%x|%x): match the " - "middle one ("CFS_DURATION_T")\n", exp, + CDEBUG(D_SEC, "exp %p (%x|%x|%x): match the middle one (" CFS_DURATION_T ")\n", exp, exp->exp_flvr.sf_rpc, exp->exp_flvr_old[0].sf_rpc, exp->exp_flvr_old[1].sf_rpc, exp->exp_flvr_expire[0] - - get_seconds()); + get_seconds()); spin_unlock(&exp->exp_lock); return 0; } @@ -1881,13 +1879,13 @@ int sptlrpc_target_export_check(struct obd_export *exp, if (exp->exp_flvr_changed == 0 && exp->exp_flvr_expire[1]) { if (exp->exp_flvr_expire[1] >= get_seconds()) { if (flavor_allowed(&exp->exp_flvr_old[1], req)) { - CDEBUG(D_SEC, "exp %p (%x|%x|%x): match the " - "oldest one ("CFS_DURATION_T")\n", exp, + CDEBUG(D_SEC, "exp %p (%x|%x|%x): match the oldest one (" CFS_DURATION_T ")\n", + exp, exp->exp_flvr.sf_rpc, exp->exp_flvr_old[0].sf_rpc, exp->exp_flvr_old[1].sf_rpc, exp->exp_flvr_expire[1] - - get_seconds()); + get_seconds()); spin_unlock(&exp->exp_lock); return 0; } @@ -1907,8 +1905,7 @@ int sptlrpc_target_export_check(struct obd_export *exp, spin_unlock(&exp->exp_lock); - CWARN("exp %p(%s): req %p (%u|%u|%u|%u|%u|%u) with " - "unauthorized flavor %x, expect %x|%x(%+ld)|%x(%+ld)\n", + CWARN("exp %p(%s): req %p (%u|%u|%u|%u|%u|%u) with unauthorized flavor %x, expect %x|%x(%+ld)|%x(%+ld)\n", exp, exp->exp_obd->obd_name, req, req->rq_auth_gss, req->rq_ctx_init, req->rq_ctx_fini, req->rq_auth_usr_root, req->rq_auth_usr_mdt, req->rq_auth_usr_ost, diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c b/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c index cc68a1cf24e3..0dabd83fd46f 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c @@ -772,8 +772,7 @@ void sptlrpc_enc_pool_fini(void) if (page_pools.epp_st_access > 0) { CDEBUG(D_SEC, - "max pages %lu, grows %u, grow fails %u, shrinks %u, " - "access %lu, missing %lu, max qlen %u, max wait " + "max pages %lu, grows %u, grow fails %u, shrinks %u, access %lu, missing %lu, max qlen %u, max wait " CFS_TIME_T"/%d\n", page_pools.epp_st_max_pages, page_pools.epp_st_grows, page_pools.epp_st_grow_fails, diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_null.c b/drivers/staging/lustre/lustre/ptlrpc/sec_null.c index 099cec3b669f..4e132435b450 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_null.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_null.c @@ -101,16 +101,7 @@ int null_ctx_verify(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req) if (req->rq_early) { cksums = lustre_msg_get_cksum(req->rq_repdata); -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 50, 0) - if (lustre_msghdr_get_flags(req->rq_reqmsg) & - MSGHDR_CKSUM_INCOMPAT18) - cksumc = lustre_msg_calc_cksum(req->rq_repmsg, 0); - else - cksumc = lustre_msg_calc_cksum(req->rq_repmsg, 1); -#else -# warning "remove checksum compatibility support for b1_8" cksumc = lustre_msg_calc_cksum(req->rq_repmsg); -#endif if (cksumc != cksums) { CDEBUG(D_SEC, "early reply checksum mismatch: %08x != %08x\n", @@ -371,16 +362,7 @@ int null_authorize(struct ptlrpc_request *req) } else { __u32 cksum; -#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 50, 0) - if (lustre_msghdr_get_flags(req->rq_reqmsg) & - MSGHDR_CKSUM_INCOMPAT18) - cksum = lustre_msg_calc_cksum(rs->rs_repbuf, 0); - else - cksum = lustre_msg_calc_cksum(rs->rs_repbuf, 1); -#else -# warning "remove checksum compatibility support for b1_8" cksum = lustre_msg_calc_cksum(rs->rs_repbuf); -#endif lustre_msg_set_cksum(rs->rs_repbuf, cksum); req->rq_reply_off = 0; } diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_plain.c b/drivers/staging/lustre/lustre/ptlrpc/sec_plain.c index 3d72b810c45c..a79cd53010a4 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_plain.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_plain.c @@ -938,8 +938,8 @@ int plain_svc_wrap_bulk(struct ptlrpc_request *req, rc = plain_generate_bulk_csum(desc, req->rq_flvr.u_bulk.hash.hash_alg, tokenv); if (rc) { - CERROR("bulk read: server failed to compute " - "checksum: %d\n", rc); + CERROR("bulk read: server failed to compute checksum: %d\n", + rc); } else { if (OBD_FAIL_CHECK(OBD_FAIL_OSC_CHECKSUM_RECEIVE)) corrupt_bulk_data(desc); diff --git a/drivers/staging/lustre/lustre/ptlrpc/service.c b/drivers/staging/lustre/lustre/ptlrpc/service.c index a8df8a792333..635b12b22cef 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/service.c +++ b/drivers/staging/lustre/lustre/ptlrpc/service.c @@ -580,8 +580,7 @@ ptlrpc_server_nthreads_check(struct ptlrpc_service *svc, svc->srv_nthrs_cpt_init = init; if (nthrs * svc->srv_ncpts > tc->tc_nthrs_max) { - CDEBUG(D_OTHER, "%s: This service may have more threads (%d) " - "than the given soft limit (%d)\n", + CDEBUG(D_OTHER, "%s: This service may have more threads (%d) than the given soft limit (%d)\n", svc->srv_name, nthrs * svc->srv_ncpts, tc->tc_nthrs_max); } @@ -1251,8 +1250,8 @@ static int ptlrpc_at_send_early_reply(struct ptlrpc_request *req) /* deadline is when the client expects us to reply, margin is the difference between clients' and servers' expectations */ DEBUG_REQ(D_ADAPTTO, req, - "%ssending early reply (deadline %+lds, margin %+lds) for " - "%d+%d", AT_OFF ? "AT off - not " : "", + "%ssending early reply (deadline %+lds, margin %+lds) for %d+%d", + AT_OFF ? "AT off - not " : "", olddl, olddl - at_get(&svcpt->scp_at_estimate), at_get(&svcpt->scp_at_estimate), at_extra); @@ -1260,17 +1259,15 @@ static int ptlrpc_at_send_early_reply(struct ptlrpc_request *req) return 0; if (olddl < 0) { - DEBUG_REQ(D_WARNING, req, "Already past deadline (%+lds), " - "not sending early reply. Consider increasing " - "at_early_margin (%d)?", olddl, at_early_margin); + DEBUG_REQ(D_WARNING, req, "Already past deadline (%+lds), not sending early reply. Consider increasing at_early_margin (%d)?", + olddl, at_early_margin); /* Return an error so we're not re-added to the timed list. */ return -ETIMEDOUT; } if (!(lustre_msghdr_get_flags(req->rq_reqmsg) & MSGHDR_AT_SUPPORT)) { - DEBUG_REQ(D_INFO, req, "Wanted to ask client for more time, " - "but no AT support"); + DEBUG_REQ(D_INFO, req, "Wanted to ask client for more time, but no AT support"); return -ENOSYS; } @@ -1296,8 +1293,7 @@ static int ptlrpc_at_send_early_reply(struct ptlrpc_request *req) * we may be past adaptive_max */ if (req->rq_deadline >= req->rq_arrival_time.tv_sec + at_get(&svcpt->scp_at_estimate)) { - DEBUG_REQ(D_WARNING, req, "Couldn't add any time " - "(%ld/%ld), not sending early reply\n", + DEBUG_REQ(D_WARNING, req, "Couldn't add any time (%ld/%ld), not sending early reply\n", olddl, req->rq_arrival_time.tv_sec + at_get(&svcpt->scp_at_estimate) - get_seconds()); @@ -1329,8 +1325,7 @@ static int ptlrpc_at_send_early_reply(struct ptlrpc_request *req) LASSERT(atomic_read(&req->rq_refcount)); /** if it is last refcount then early reply isn't needed */ if (atomic_read(&req->rq_refcount) == 1) { - DEBUG_REQ(D_ADAPTTO, reqcopy, "Normal reply already sent out, " - "abort sending early reply\n"); + DEBUG_REQ(D_ADAPTTO, reqcopy, "Normal reply already sent out, abort sending early reply\n"); rc = -EINVAL; goto out; } @@ -1454,16 +1449,14 @@ static int ptlrpc_at_check_timed(struct ptlrpc_service_part *svcpt) spin_unlock(&svcpt->scp_at_lock); - CDEBUG(D_ADAPTTO, "timeout in %+ds, asking for %d secs on %d early " - "replies\n", first, at_extra, counter); + CDEBUG(D_ADAPTTO, "timeout in %+ds, asking for %d secs on %d early replies\n", + first, at_extra, counter); if (first < 0) { /* We're already past request deadlines before we even get a chance to send early replies */ - LCONSOLE_WARN("%s: This server is not able to keep up with " - "request traffic (cpu-bound).\n", + LCONSOLE_WARN("%s: This server is not able to keep up with request traffic (cpu-bound).\n", svcpt->scp_service->srv_name); - CWARN("earlyQ=%d reqQ=%d recA=%d, svcEst=%d, " - "delay="CFS_DURATION_T"(jiff)\n", + CWARN("earlyQ=%d reqQ=%d recA=%d, svcEst=%d, delay=" CFS_DURATION_T "(jiff)\n", counter, svcpt->scp_nreqs_incoming, svcpt->scp_nreqs_active, at_get(&svcpt->scp_at_estimate), delay); @@ -1825,8 +1818,7 @@ ptlrpc_server_handle_req_in(struct ptlrpc_service_part *svcpt, if (rc == 0) { rc = sptlrpc_target_export_check(req->rq_export, req); if (rc) - DEBUG_REQ(D_ERROR, req, "DROPPING req with " - "illegal security flavor,"); + DEBUG_REQ(D_ERROR, req, "DROPPING req with illegal security flavor,"); } if (rc) @@ -1942,18 +1934,17 @@ ptlrpc_server_handle_request(struct ptlrpc_service_part *svcpt, /* Discard requests queued for longer than the deadline. The deadline is increased if we send an early reply. */ if (get_seconds() > request->rq_deadline) { - DEBUG_REQ(D_ERROR, request, "Dropping timed-out request from %s" - ": deadline "CFS_DURATION_T":"CFS_DURATION_T"s ago\n", + DEBUG_REQ(D_ERROR, request, "Dropping timed-out request from %s: deadline " CFS_DURATION_T ":" CFS_DURATION_T "s ago\n", libcfs_id2str(request->rq_peer), cfs_time_sub(request->rq_deadline, - request->rq_arrival_time.tv_sec), + request->rq_arrival_time.tv_sec), cfs_time_sub(get_seconds(), - request->rq_deadline)); + request->rq_deadline)); goto put_conn; } - CDEBUG(D_RPCTRACE, "Handling RPC pname:cluuid+ref:pid:xid:nid:opc " - "%s:%s+%d:%d:x%llu:%s:%d\n", current_comm(), + CDEBUG(D_RPCTRACE, "Handling RPC pname:cluuid+ref:pid:xid:nid:opc %s:%s+%d:%d:x%llu:%s:%d\n", + current_comm(), (request->rq_export ? (char *)request->rq_export->exp_client_uuid.uuid : "0"), (request->rq_export ? @@ -1986,26 +1977,24 @@ put_conn: do_gettimeofday(&work_end); timediff = cfs_timeval_sub(&work_end, &work_start, NULL); - CDEBUG(D_RPCTRACE, "Handled RPC pname:cluuid+ref:pid:xid:nid:opc " - "%s:%s+%d:%d:x%llu:%s:%d Request processed in " - "%ldus (%ldus total) trans %llu rc %d/%d\n", - current_comm(), - (request->rq_export ? - (char *)request->rq_export->exp_client_uuid.uuid : "0"), - (request->rq_export ? - atomic_read(&request->rq_export->exp_refcount) : -99), - lustre_msg_get_status(request->rq_reqmsg), - request->rq_xid, - libcfs_id2str(request->rq_peer), - lustre_msg_get_opc(request->rq_reqmsg), - timediff, - cfs_timeval_sub(&work_end, &request->rq_arrival_time, NULL), - (request->rq_repmsg ? - lustre_msg_get_transno(request->rq_repmsg) : - request->rq_transno), - request->rq_status, - (request->rq_repmsg ? - lustre_msg_get_status(request->rq_repmsg) : -999)); + CDEBUG(D_RPCTRACE, "Handled RPC pname:cluuid+ref:pid:xid:nid:opc %s:%s+%d:%d:x%llu:%s:%d Request processed in %ldus (%ldus total) trans %llu rc %d/%d\n", + current_comm(), + (request->rq_export ? + (char *)request->rq_export->exp_client_uuid.uuid : "0"), + (request->rq_export ? + atomic_read(&request->rq_export->exp_refcount) : -99), + lustre_msg_get_status(request->rq_reqmsg), + request->rq_xid, + libcfs_id2str(request->rq_peer), + lustre_msg_get_opc(request->rq_reqmsg), + timediff, + cfs_timeval_sub(&work_end, &request->rq_arrival_time, NULL), + (request->rq_repmsg ? + lustre_msg_get_transno(request->rq_repmsg) : + request->rq_transno), + request->rq_status, + (request->rq_repmsg ? + lustre_msg_get_status(request->rq_repmsg) : -999)); if (likely(svc->srv_stats != NULL && request->rq_reqmsg != NULL)) { __u32 op = lustre_msg_get_opc(request->rq_reqmsg); int opc = opcode_offset(op); @@ -2557,8 +2546,8 @@ static int ptlrpc_start_hr_threads(void) if (!IS_ERR_VALUE(rc)) continue; - CERROR("Reply handling thread %d:%d Failed on starting: " - "rc = %d\n", i, j, rc); + CERROR("Reply handling thread %d:%d Failed on starting: rc = %d\n", + i, j, rc); ptlrpc_stop_hr_threads(); return rc; } @@ -2920,8 +2909,7 @@ ptlrpc_service_unlink_rqbd(struct ptlrpc_service *svc) rc = l_wait_event(svcpt->scp_waitq, svcpt->scp_nrqbds_posted == 0, &lwi); if (rc == -ETIMEDOUT) { - CWARN("Service %s waiting for " - "request buffers\n", + CWARN("Service %s waiting for request buffers\n", svcpt->scp_service->srv_name); } spin_lock(&svcpt->scp_lock); |