Subject: Re: Initialising the same pool multiple times
To: None <simonb@wasabisystems.com>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: tech-kern
Date: 02/14/2006 11:36:19
> Hi folks,
>
> At the moment, it's possible to call pool_init() multiple times for
> same pool. Currently, this corrupts the "all-pools" list such that
> "vmstat -m" will now endlessly loop. The patch below panics if this
> happens when DIAGNOSTIC is enabled, and otherwise prints a warning
> then returns early..
>
> Is this the best way to handle this condition? Should the warning be
> inside an "#ifdef DEBUG" check?
i think it's a plain bug in the caller. so i'd suggest the following.
printing a warning sounds nonsense to me. panic should be fine.
#ifdef DEBUG
LIST_FOREACH() {
if (pp == pp1) {
panic();
}
}
#endif
YAMAMOTO Takashi