Re: [PATCH] disk-utils: Let mkswap default to V1 in any case

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Karel Zak <kzak@xxxxxxxxxx> writes:

> On Wed, Jul 18, 2007 at 04:15:45PM +0200, Matthias Koenig wrote:
>> Signed-off-by: Matthias Koenig <mkoenig@xxxxxxx>
>> ---
>>  disk-utils/mkswap.c |    4 +---
>>  1 files changed, 1 insertions(+), 3 deletions(-)
>> 
>> diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c
>> index 8cafd8f..fdd3e0d 100644
>> --- a/disk-utils/mkswap.c
>> +++ b/disk-utils/mkswap.c
>> @@ -617,9 +617,7 @@ main(int argc, char ** argv) {
>>  			version = 1;
>>  		else
>>  		/* use version 1 as default, if possible */
>> -		if (PAGES <= V0_MAX_PAGES && PAGES > V1_MAX_PAGES)
>
>  hmm... that's really a strange test. I think V0_MAX_PAGES is
>  greater that V1_MAX_PAGES when you define pagesize > 16kB
>  only...
>
>  From my point of view it seems strange, but not like a bug.
>
>  Matthias, do you have any example, test case or whatever? How
>  did you found it? :-)

It has been reported to us, use case might be ppc64 with CONFIG_PPC_64K_PAGES.
Yes, it appears only with pagesize > 16kB
As version 0 swap is not supported anymore by recent kernels, the behaviour
in this case is rather strange (of course you can still use explicitly the
-v1 option).

Here is a testcase:
# for i in 4 8 16 32 64; do mkswap -p `expr $i \* 1024` ./swap.file; done

Setting up swapspace version 1, size = 4294963 kB

Using user-specified page size 8192, instead of the system values 4096/4096
Setting up swapspace version 1, size = 4294959 kB

Using user-specified page size 16384, instead of the system values 4096/4096
Setting up swapspace version 1, size = 4294950 kB

Using user-specified page size 32768, instead of the system values 4096/4096
Setting up swapspace version 0, size = 4294934 kB

Using user-specified page size 65536, instead of the system values 4096/4096
Setting up swapspace version 0, size = 4294901 kB

Matthias

-
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux