From da1d93513fdff0a70257b13aa5649e478d4f70b6 Mon Sep 17 00:00:00 2001 From: Lei Feng Date: Fri, 5 Mar 2021 20:01:37 +0800 Subject: [PATCH] LU-14475 log: Rewrite some log messages Some log messages are too short to be meaningful. Rewrite them. Signed-off-by: Lei Feng Test-Parameters: trivial Change-Id: I9ae7d7da23c7e227c4e2b84010fb0c2a06b8cc87 Reviewed-on: https://review.whamcloud.com/41892 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Arshad Hussain --- lustre/obdclass/lu_object.c | 26 +++++++++++++------------- lustre/osd-ldiskfs/osd_iam_lvar.c | 3 ++- lustre/osd-ldiskfs/osd_io.c | 2 +- lustre/ptlrpc/gss/gss_pipefs.c | 17 +++++++++-------- lustre/ptlrpc/gss/gss_rawobj.c | 13 ++++++++----- 5 files changed, 33 insertions(+), 28 deletions(-) diff --git a/lustre/obdclass/lu_object.c b/lustre/obdclass/lu_object.c index b381cfe..3a07035 100644 --- a/lustre/obdclass/lu_object.c +++ b/lustre/obdclass/lu_object.c @@ -2277,20 +2277,20 @@ void lu_context_keys_dump(void) { unsigned int i; - for (i = 0; i < ARRAY_SIZE(lu_keys); ++i) { - struct lu_context_key *key; + for (i = 0; i < ARRAY_SIZE(lu_keys); ++i) { + struct lu_context_key *key; - key = lu_keys[i]; - if (key != NULL) { - CERROR("[%d]: %p %x (%p,%p,%p) %d %d \"%s\"@%p\n", - i, key, key->lct_tags, - key->lct_init, key->lct_fini, key->lct_exit, - key->lct_index, atomic_read(&key->lct_used), - key->lct_owner ? key->lct_owner->name : "", - key->lct_owner); - lu_ref_print(&key->lct_reference); - } - } + key = lu_keys[i]; + if (key != NULL) { + CERROR("LU context keys [%d]: %p %x (%p,%p,%p) %d %d \"%s\"@%p\n", + i, key, key->lct_tags, + key->lct_init, key->lct_fini, key->lct_exit, + key->lct_index, atomic_read(&key->lct_used), + key->lct_owner ? key->lct_owner->name : "", + key->lct_owner); + lu_ref_print(&key->lct_reference); + } + } } /** diff --git a/lustre/osd-ldiskfs/osd_iam_lvar.c b/lustre/osd-ldiskfs/osd_iam_lvar.c index 2511176..66aff9e 100644 --- a/lustre/osd-ldiskfs/osd_iam_lvar.c +++ b/lustre/osd-ldiskfs/osd_iam_lvar.c @@ -342,7 +342,8 @@ static int n_invariant(const struct iam_leaf *leaf) * locked. */ n_print(leaf); - CERROR("%#x < %#x\n", nexthash, starthash); + CERROR("invalid hash value less than start hash: %#x < %#x\n", + nexthash, starthash); dump_stack(); return 0; } diff --git a/lustre/osd-ldiskfs/osd_io.c b/lustre/osd-ldiskfs/osd_io.c index 2f3c0ff..ef428ee 100644 --- a/lustre/osd-ldiskfs/osd_io.c +++ b/lustre/osd-ldiskfs/osd_io.c @@ -173,7 +173,7 @@ static void dio_complete_routine(struct bio *bio, int error) */ if (unlikely(iobuf == NULL)) { - CERROR("***** bio->bi_private is NULL! This should never happen. Normally, I would crash here, but instead I will dump the bio contents to the console. Please report this to , along with any interesting messages leading up to this point (like SCSI errors, perhaps). Because bi_private is NULL, I can't wake up the thread that initiated this IO - you will probably have to reboot this node.\n"); + CERROR("***** bio->bi_private is NULL! Dump the bio contents to the console. Please report this to , and probably have to reboot this node.\n"); CERROR("bi_next: %p, bi_flags: %lx, " __stringify(bi_opf) ": %x, bi_vcnt: %d, bi_idx: %d, bi->size: %d, bi_end_io: %p, bi_cnt: %d, bi_private: %p\n", bio->bi_next, (unsigned long)bio->bi_flags, diff --git a/lustre/ptlrpc/gss/gss_pipefs.c b/lustre/ptlrpc/gss/gss_pipefs.c index 5e1e7ca..4a21cc7 100644 --- a/lustre/ptlrpc/gss/gss_pipefs.c +++ b/lustre/ptlrpc/gss/gss_pipefs.c @@ -789,15 +789,16 @@ struct gss_upcall_msg * gss_find_upcall(__u32 mechidx, __u32 seq) static int simple_get_bytes(char **buf, __u32 *buflen, void *res, __u32 reslen) { - if (*buflen < reslen) { - CERROR("buflen %u < %u\n", *buflen, reslen); - return -EINVAL; - } + if (*buflen < reslen) { + CERROR("shorter buflen than needed: %u < %u\n", + *buflen, reslen); + return -EINVAL; + } - memcpy(res, *buf, reslen); - *buf += reslen; - *buflen -= reslen; - return 0; + memcpy(res, *buf, reslen); + *buf += reslen; + *buflen -= reslen; + return 0; } /**************************************** diff --git a/lustre/ptlrpc/gss/gss_rawobj.c b/lustre/ptlrpc/gss/gss_rawobj.c index fd4e390..1400414 100644 --- a/lustre/ptlrpc/gss/gss_rawobj.c +++ b/lustre/ptlrpc/gss/gss_rawobj.c @@ -117,7 +117,8 @@ int rawobj_serialize(rawobj_t *obj, __u32 **buf, __u32 *buflen) len = cfs_size_round4(obj->len); if (*buflen < 4 + len) { - CERROR("buflen %u < %u\n", *buflen, 4 + len); + CERROR("shorter buflen than needed: %u < %u\n", + *buflen, 4 + len); return -EINVAL; } @@ -135,7 +136,7 @@ static int __rawobj_extract(rawobj_t *obj, __u32 **buf, __u32 *buflen, __u32 len; if (*buflen < sizeof(__u32)) { - CERROR("buflen %u\n", *buflen); + CERROR("too short buflen: %u\n", *buflen); return -EINVAL; } @@ -151,7 +152,8 @@ static int __rawobj_extract(rawobj_t *obj, __u32 **buf, __u32 *buflen, len = local ? obj->len : cfs_size_round4(obj->len); if (*buflen < len) { - CERROR("buflen %u < %u\n", *buflen, len); + CERROR("shorter buflen than object size: %u < %u\n", + *buflen, len); obj->len = 0; return -EINVAL; } @@ -208,7 +210,7 @@ int rawobj_from_netobj_alloc(rawobj_t *rawobj, netobj_t *netobj) if (netobj->len == 0) return 0; - + OBD_ALLOC_LARGE(rawobj->data, netobj->len); if (rawobj->data == NULL) return -ENOMEM; @@ -226,7 +228,8 @@ int buffer_extract_bytes(const void **buf, __u32 *buflen, void *res, __u32 reslen) { if (*buflen < reslen) { - CERROR("buflen %u < %u\n", *buflen, reslen); + CERROR("shorter buflen than expected: %u < %u\n", + *buflen, reslen); return -EINVAL; } -- 1.8.3.1