File 0010-Grow-fix-that-preventing-resize-of-array-to-32bit-si.patch of Package mdadm.5365
From 4e9a3dd16d656b269f5602624ac4f7109a571368 Mon Sep 17 00:00:00 2001
From: NeilBrown <neilb@suse.de>
Date: Mon, 21 Jul 2014 16:51:53 +1000
Subject: [PATCH 016/359] Grow: fix that preventing resize of array to 32bit
size.
References: bsc#1081910
If the request --size to --grow an array to is 32bits
(i.e. msb in bit 32) then mdadm make wrong choice and
uses ioctl instead of setting component_size via sysfs
and the change is ignored.
This is fixed by using correct casts.
Reported-and-tested-by: Killian De Volder <killian.de.volder@megasoft.be>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Coly Li <colyli@suse.de>
---
Grow.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Grow.c b/Grow.c
index ea9cc60..af59347 100644
--- a/Grow.c
+++ b/Grow.c
@@ -1813,7 +1813,7 @@ int Grow_reshape(char *devname, int fd,
if (s->size == MAX_SIZE)
s->size = 0;
array.size = s->size;
- if ((unsigned)array.size != s->size) {
+ if (array.size != (signed)s->size) {
/* got truncated to 32bit, write to
* component_size instead
*/
--
2.16.1