From ebb323b2e0befeda5db7d628ea617682d87aa98e Mon Sep 17 00:00:00 2001 From: Timothy Day Date: Sat, 1 Jun 2024 04:32:01 +0000 Subject: [PATCH] LU-17844 oss: remove all LCONSOLE_ERROR_MSG() These magic numbers aren't so magical anymore. Just use LCONSOLE_ERROR(). Test-Parameters: trivial Signed-off-by: Timothy Day Change-Id: Id7ae3b50478c434203adfb375cb31f158d4b29d4 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55281 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Arshad Hussain Reviewed-by: Oleg Drokin --- lustre/ofd/ofd_obd.c | 7 ++--- lustre/osc/osc_request.c | 78 +++++++++++++++++++++--------------------------- 2 files changed, 37 insertions(+), 48 deletions(-) diff --git a/lustre/ofd/ofd_obd.c b/lustre/ofd/ofd_obd.c index 15e5a2b..fbc55a8 100644 --- a/lustre/ofd/ofd_obd.c +++ b/lustre/ofd/ofd_obd.c @@ -216,10 +216,9 @@ static int ofd_parse_connect_data(const struct lu_env *env, int index = lsd->lsd_osd_index; if (index != data->ocd_index) { - LCONSOLE_ERROR_MSG(0x136, - "Connection from %s to index %u doesn't match actual OST index %u in last_rcvd file, bad configuration?\n", - obd_export_nid2str(exp), index, - data->ocd_index); + LCONSOLE_ERROR("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); } if (!(lsd->lsd_feature_compat & OBD_COMPAT_OST)) { diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index ef37a6e..6e32741 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -2089,31 +2089,25 @@ check_write_checksum(struct obdo *oa, const struct lnet_processid *peer, if (rc < 0) msg = "failed to calculate the client write checksum"; else if (cksum_type != obd_cksum_type_unpack(aa->aa_oa->o_flags)) - msg = "the server did not use the checksum type specified in " - "the original request - likely a protocol problem"; - else if (new_cksum == server_cksum) - msg = "changed on the client after we checksummed it - " - "likely false positive due to mmap IO (bug 11742)"; - else if (new_cksum == client_cksum) - msg = "changed in transit before arrival at OST"; - else - msg = "changed in transit AND doesn't match the original - " - "likely false positive due to mmap IO (bug 11742)"; - - LCONSOLE_ERROR_MSG(0x132, "%s: BAD WRITE CHECKSUM: %s: from %s inode " - DFID " object "DOSTID" extent [%llu-%llu], original " - "client csum %x (type %x), server csum %x (type %x)," - " client csum now %x\n", - obd_name, msg, libcfs_nidstr(&peer->nid), - oa->o_valid & OBD_MD_FLFID ? oa->o_parent_seq : (__u64)0, - oa->o_valid & OBD_MD_FLFID ? oa->o_parent_oid : 0, - oa->o_valid & OBD_MD_FLFID ? oa->o_parent_ver : 0, - POSTID(&oa->o_oi), aa->aa_ppga[0]->bp_off, - aa->aa_ppga[aa->aa_page_count - 1]->bp_off + - aa->aa_ppga[aa->aa_page_count-1]->bp_count - 1, - client_cksum, - obd_cksum_type_unpack(aa->aa_oa->o_flags), - server_cksum, cksum_type, new_cksum); + msg = "the server did not use the checksum type specified in the original request - likely a protocol problem"; + else if (new_cksum == server_cksum) + msg = "changed on the client after we checksummed it - likely false positive due to mmap IO (bug 11742)"; + else if (new_cksum == client_cksum) + msg = "changed in transit before arrival at OST"; + else + msg = "changed in transit AND doesn't match the original - likely false positive due to mmap IO (bug 11742)"; + + LCONSOLE_ERROR("%s: BAD WRITE CHECKSUM: %s: from %s inode " DFID " object " DOSTID " extent [%llu-%llu], original client csum %x (type %x), server csum %x (type %x), client csum now %x\n", + obd_name, msg, libcfs_nidstr(&peer->nid), + oa->o_valid & OBD_MD_FLFID ? oa->o_parent_seq : (__u64)0, + oa->o_valid & OBD_MD_FLFID ? oa->o_parent_oid : 0, + oa->o_valid & OBD_MD_FLFID ? oa->o_parent_ver : 0, + POSTID(&oa->o_oi), aa->aa_ppga[0]->bp_off, + aa->aa_ppga[aa->aa_page_count - 1]->bp_off + + aa->aa_ppga[aa->aa_page_count-1]->bp_count - 1, + client_cksum, + obd_cksum_type_unpack(aa->aa_oa->o_flags), + server_cksum, cksum_type, new_cksum); return 1; } @@ -2284,25 +2278,21 @@ static int osc_brw_fini_request(struct ptlrpc_request *req, int rc) aa->aa_ppga, server_cksum, client_cksum); - LCONSOLE_ERROR_MSG(0x133, "%s: BAD READ CHECKSUM: from " - "%s%s%s inode "DFID" object "DOSTID - " extent [%llu-%llu], client %x/%x, " - "server %x, cksum_type %x\n", - obd_name, - libcfs_nidstr(&peer->nid), - via, router, - clbody->oa.o_valid & OBD_MD_FLFID ? - clbody->oa.o_parent_seq : 0ULL, - clbody->oa.o_valid & OBD_MD_FLFID ? - clbody->oa.o_parent_oid : 0, - clbody->oa.o_valid & OBD_MD_FLFID ? - clbody->oa.o_parent_ver : 0, - POSTID(&body->oa.o_oi), - aa->aa_ppga[0]->bp_off, - aa->aa_ppga[page_count-1]->bp_off + - aa->aa_ppga[page_count-1]->bp_count - 1, - client_cksum, client_cksum2, - server_cksum, cksum_type); + LCONSOLE_ERROR("%s: BAD READ CHECKSUM: from %s%s%s inode " DFID " object " DOSTID " extent [%llu-%llu], client %x/%x, server %x, cksum_type %x\n", + obd_name, libcfs_nidstr(&peer->nid), + via, router, + clbody->oa.o_valid & OBD_MD_FLFID ? + clbody->oa.o_parent_seq : 0ULL, + clbody->oa.o_valid & OBD_MD_FLFID ? + clbody->oa.o_parent_oid : 0, + clbody->oa.o_valid & OBD_MD_FLFID ? + clbody->oa.o_parent_ver : 0, + POSTID(&body->oa.o_oi), + aa->aa_ppga[0]->bp_off, + aa->aa_ppga[page_count-1]->bp_off + + aa->aa_ppga[page_count-1]->bp_count - 1, + client_cksum, client_cksum2, + server_cksum, cksum_type); cksum_counter = 0; aa->aa_oa->o_cksum = client_cksum; rc = -EAGAIN; -- 1.8.3.1