Details
-
Bug
-
Resolution: Fixed
-
Minor
-
Lustre 2.6.0
-
3
-
11329
Description
Playing with the stack tool, it uncovered this strange piece in mdc_changelog_send_thread:
/* Send EOF no matter what our result */ if ((kuch = changelog_kuc_hdr(cs->cs_buf, sizeof(*kuch), cs->cs_flags))) { kuch->kuc_msgtype = CL_EOF; libcfs_kkuc_msg_put(cs->cs_fp, kuch); }
Now, the thing is that changelog_kuc_hdr never returns NULL as we pass the pointer into it already and if it's zero, we'd totally die before even returning:
static struct kuc_hdr *changelog_kuc_hdr(char *buf, int len, int flags) { struct kuc_hdr *lh = (struct kuc_hdr *)buf; LASSERT(len <= KUC_CHANGELOG_MSG_MAXSIZE); lh->kuc_magic = KUC_MAGIC; lh->kuc_transport = KUC_TRANSPORT_CHANGELOG; lh->kuc_flags = flags; lh->kuc_msgtype = CL_RECORD; lh->kuc_msglen = len; return lh; }
So I guess weeither should do away with the if here and make for a more readable code, or actually insert some checks into changelog_kuc_hdr
Attachments
Issue Links
- is related to
-
LU-2753 Tracking bug for static code analysis fixes.
- Resolved