Re: File Corruption Bug.. continued

Guest section DW (dwguest@win.tue.nl)
Thu, 24 Jun 1999 01:54:05 +0200 (MET DST)


Hmm - hardly have I said that you sound like the swap code is buggy
or you ask:

> would someone verify this change (page_alloc.c) is absolutely safe

> - if (PageSwapCache(page_map))
> - delete_from_swap_cache(page_map);
> + delete_from_swap_cache(page_map);

One would almost think that you found the problem.

swap_state.c warns:

/*
* This must be called only on pages that have
* been verified to be in the swap cache.
*/
void delete_from_swap_cache(struct page *page)

But then, on the other hand, where did we get page_map?
Either from lookup_swap_cache() or from read_swap_cache().
And read_swap_cache() gets it from lookup_swap_cache() or
hands it to add_to_swap_cache().
And add_to_swap_cache() does PageTestandSetSwapCache().
And lookup_swap_cache() checks PageSwapCache().
So, at first sight, it seems that Andrea was right when he said

: The check for PageSwapCache() was useless.

On the other hand, it seems silly to remove such a check.
The check costs nothing, and removing it makes the code
less robust. You may well add it again.

Andries

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