Re: [CHECKER] repetitive/contradictory comparison bugs for 2.4.7
Neil Brown (neilb@cse.unsw.edu.au)
Wed, 25 Jul 2001 10:51:36 +1000 (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/