Re: ANNOUNCE: mdadm 3.0 - A tool for managing Soft RAID under Linux

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

 



Neil Brown wrote:
On Wednesday June 3, babydr@xxxxxxxxxxxxxxxx wrote:
 	Hello Neil ,  I am getting a interesting Error during compiling 3.0 .
Is there a particular version of kernel that 3.0 is supposed to be compiled with ?

This has nothing to do with kernel version.  You must be using a
different compiler version - it is picking up an error that might
didn't.

The fix is below.
Thanks,
NeilBrown


 		Tia ,  JimL

gcc -Wall -Werror -Wstrict-prototypes -ggdb -DSendmail=\""/usr/sbin/sendmail -t"\" -DCONFFILE=\"/etc/mdadm.conf\" -DCONFFILE2=\"/etc/mdadm/mdadm.conf\" -c -o super-intel.o super-intel.c
cc1: warnings being treated as errors
super-intel.c: In function 'mark_failure':
super-intel.c:3632: warning: comparison is always false due to limited range of data type
make: *** [super-intel.o] Error 1


commit 4291d691b66f65695b5b4be22b80fd00da73b544
Author: NeilBrown <neilb@xxxxxxx>
Date:   Thu Jun 4 12:29:21 2009 +1000

    super-intel: fix test on failed_disk_num.
We sometimes set failed_disk_num to ~0.
    However we cannot test for equality with that as  failed_disk_num
    is 8bit and ~0 is probably 32bit with lots of 1's.
    So test if ~failed_disk_num is 0 instead.
Reported-By: "Mr. James W. Laferriere" <babydr@xxxxxxxxxxxxxxxx>
    Signed-off-by: NeilBrown <neilb@xxxxxxx>

diff --git a/super-intel.c b/super-intel.c
index 73fe5fa..7e2a086 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -3629,7 +3629,7 @@ static int mark_failure(struct imsm_dev *dev, struct imsm_disk *disk, int idx)
disk->status |= FAILED_DISK;
 	set_imsm_ord_tbl_ent(map, slot, idx | IMSM_ORD_REBUILD);
-	if (map->failed_disk_num == ~0)
+	if (~map->failed_disk_num == 0)
 		map->failed_disk_num = slot;
 	return 1;
 }

I still don't think this is really portable, the zero should be cast using typeof.

--
Bill Davidsen <davidsen@xxxxxxx>
 Even purely technical things can appear to be magic, if the documentation is
obscure enough. For example, PulseAudio is configured by dancing naked around a
fire at midnight, shaking a rattle with one hand and a LISP manual with the
other, while reciting the GNU manifesto in hexadecimal. The documentation fails
to note that you must circle the fire counter-clockwise in the southern
hemisphere.


--
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