Re: Some bugs in swap_state.c

Benjamin C.R. LaHaise (blah@kvack.org)
Sun, 22 Mar 1998 10:51:28 -0500 (EST)


On Sun, 22 Mar 1998, Chirayu Patel wrote:

> Hi,
>
> I was going through the swap_state.c code and would like to report the
> following bugs/suggestions.
>
> 1. There is a call to free_page (addr) at the end of the function
> free_page_and_swap_cache (unsigned long addr). Since we are calling
> __free_page (page) in remove_from_swap_cache this call is not correct. Can
> anyone tell me hte problems which can be caused due to freeing a page
> which is already freed. Are the necessary checks for this in place?

Ummmm, are you sure? Remember that page-cache pages will have a use count
beginning at 2.

> 2. Function find_in_swap_cache(struct page *page) dosent seem to be used
> anywhere, so might as well remove it from the file. The name also dosent
> make any sense.

Looks good -- must've been a leftover from Stephen's swap cache cleanup.

> 3. I have removed a trivial check from the function lookup_swap_cache as
> it seems to be unnecessary after the call to find_page.
...

It is a debugging/stanity check item -> without the comparison of
page->inode against &swapper_inode, the check is not so useful.

-ben

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu