Re: [CHECKER] repetitive/contradictory comparison bugs for 2.4.7

From: Neil Brown (neilb@cse.unsw.edu.au)
Date: Tue Jul 24 2001 - 19:51:36 EST


On Tuesday July 24, nave@stanford.edu wrote:
> [BUG] confusing: why check twice? race condition?
> /home/eparker/tmp/linux/2.4.7/drivers/md/md.c:1633:do_md_run: ERROR:INTERNAL_NULL3:1627:1633: Repetitive check: "pers[pnum]" is NULL so the conditional "pers[pnum] == 0" will always evaluate to true! [distance=4]
> */
> printk(BAD_CHUNKSIZE);
> return -EINVAL;
> }
>
> Start --->
> if (!pers[pnum])
> {
> #ifdef CONFIG_KMOD
> char module_name[80];
> sprintf (module_name, "md-personality-%d", pnum);
> request_module (module_name);
> Error --->
> if (!pers[pnum])
> #endif
> return -EINVAL;
> }

This one is not a bug. "request_module" will hopefully load a module
and run it's init routine, which should set pers[pnum] to some proper
value.
Ofcourse, it might not, so we have to check.

Note that "pers" here is a global variable, and so it should be
expected that an external function - i.e. request_module - might
change it.

Thanks anyway.

NeilBrown
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Jul 31 2001 - 21:00:21 EST