What does the '-1' value of size mean now?

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

 



Hi Neil

What does the '-1' value of size (Grow.c:1990 and Grow.c:2678) mean now regarding your recent patch:?

>From d04f65f48c93e7e57cc3c1d70dd07d094dece717 Mon Sep 17 00:00:00 2001
From: NeilBrown <neilb@xxxxxxx>
Date: Mon, 9 Jul 2012 17:20:32 +1000
Subject: [PATCH] Change the values for "max size" from -1 to 1.

There are two places (Grow.c:1990 and Grow.c:2678) where reshape_super() is called with size==-1. Is it still right?

I am asking you because you have changed also the 'size' parameter of imsm_reshape_super() from signed to unsigned (super-intel.c:9884). 
When reshape_super() is called with size==-1 at Grow.c:2678, imsm_reshape_super() is called with size==-1 too, so the size is converted to unsigned value 0xFFFFFFFFFFFFFFFF and the logic is broken down, because the condition "geo->size != -1" at super-intel.c:9310 had been false previously and now the condition "geo->size > 0" is true, because size==0xFFFFFFFFFFFFFFFF now:

@@ -9307,7 +9307,7 @@ static int imsm_reshape_is_allowed_on_container(struct supertype *st,
 		"st->devnum = (%i)\n",
 		st->devnum);
 
-	if (geo->size != -1 ||
+	if (geo->size > 0 ||

I am going to correct it, but I don't know if the '-1' value of size parameter at Grow.c:1990 and Grow.c:2678 is still right?

Regards,
Lukasz


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


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux