[PATCH 18/25] staging: lustre: libcfs: clear up failure patch in cfs_cpt_*_print

Dan Carpenter dan.carpenter at oracle.com
Tue Apr 17 07:39:02 UTC 2018


> -err:
> -	if (rc < 0)
> -		return rc;
> -
>  	return tmp - buf;
> +
> +err:
> +	return -E2BIG;


We finally fixed this bug!  Hooray!  But it's like you guys are
deliberately writing in terrible style.  You can just return directly
and then you would have avoided this bug altogether from square one!

People think that by adding little twists and moving code to the end
of the function the it will be less buggy.  It's not true.  It's like at
a hospital if they just swept the cockroaches under the bed, just
because it's at the end of the function where you can't see it or review
it doesn't mean it's not buggy.

regards,
dan carpenter



More information about the devel mailing list