RE: [PATCH] staging:lustre: Prevent duplicate CT registrations

From: Simmons, James A.
Date: Tue Nov 03 2015 - 19:20:56 EST


>On Fri, Oct 23, 2015 at 03:59:14PM -0400, James Simmons wrote:
>> diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
>> index 635a93c..d6d70d8 100644
>> --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c
>> +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
>> @@ -794,7 +794,9 @@ static void lmv_hsm_req_build(struct lmv_obd *lmv,
>> static int lmv_hsm_ct_unregister(struct lmv_obd *lmv, unsigned int cmd, int len,
>> struct lustre_kernelcomm *lk, void *uarg)
>> {
>> - int i, rc = 0;
>> + struct kkuc_ct_data *kcd = NULL;
>> + int rc = 0;
>> + __u32 i;
>
>We have been introducing a lot of new __u32 types here and I just
>assumed there was a reason for it but this one is clearly wrong. The
>new code implies that ->ld_tgt_count can overflow INT_MAX which is not
>true and that this is code shared with userspace which might be true but
>it's not described in the changelog. Is this a static checker fix?
>Stop using that broken static checker, because the correct type here is
>int.

No this patch is from a real fix. You can read the details at
https://jira.hpdd.intel.com/browse/LU-3882. I bet he did this to avoid
the pickiness of gcc. We have build failure due to gcc stupidity. I could
be wrong which if that is the case the original Author is CC.

>Anyway, stop making gratuitous unrelated changes (like the white space
>changes to local declarations). I feel like I have held off commenting
>on this for a while and shown great restraint. :P

This is a direct drop of the original patch. I see lots of corrections to the
code below. Would a new follow on patch to correct these issues be okay
with you. This way we can perverse our bug fix history.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/