From: Linus Torvalds (torvalds@klaava.Helsinki.FI)
Date: 03/16/93


From: torvalds@klaava.Helsinki.FI (Linus Torvalds)
Subject: Re: [FIX] What's pl7 done to my swap paritions?
Date: 16 Mar 1993 22:04:59 GMT

In article <1993Mar15.201901.9041@galileo.cc.rochester.edu> ctne_ltd@uhura.cc.rochester.edu (Chris Newbold) writes:
>I just booted up pl7 and all looks well, except for my swap
>paritions. I have two: one on /dev/sda8 (8MB) and one on
>/dev/sdb5 (16MB). At boot, swapon reports:
>
>Adding 8172k swap on /dev/sda8
>Adding 8172k swap on /dev/sdb5
>
>Why doesn't it give me the full 16MB??? Has something changed
>with swapping that I don't know about? I know Linus messed
>around with the memory manager a bit....

I did indeed mess around with the memory manager, and the above is the
result of a typo. It only affects usage with several swap-files or
partitions, but can result in problems under such a setup, so please
apply this fix if you have pl7 and are using several swap-files.

In the file linux/mm/swap,c, around line 665, there is a line like this:

        read_swap_page(type < 1, tmp);

The bug is the '<' - it should be a '<<'. Even more preferable is to
use the macro that is means tof just this kind of thing, so please
change the above line to:

        read_swap_page(SWP_ENTRY(type,0), tmp);

and you should be all set.. Hope it didn't bite anybody,

                Linus