summaryrefslogtreecommitdiffstats
path: root/Detail.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2010-07-22 07:28:15 +0200
committerNeilBrown <neilb@suse.de>2010-07-22 07:35:54 +0200
commit3e4165619b146d3134838c6546778c02308c462e (patch)
tree37c2b8e1ce7f22108671e9fd40d3e22101b7cc27 /Detail.c
parentsuper-0.90: don't write bitmap larger than 60K (diff)
downloadmdadm-3e4165619b146d3134838c6546778c02308c462e.tar.xz
mdadm-3e4165619b146d3134838c6546778c02308c462e.zip
Cast to long long before left-shifting too much.
When left-shifting we must be sure that the value being shifted is large enough to not lose bits. The 'chunkssize' in CreateBitmap is only 'long' so it can overflow. So cast to 'long long' first. Also fix a similar issue in Detail even though it isn't currently being compiled. Signed-off-by: NeilBrown <neilb@suse.de> Reported-by: Tomasz Chmielewski <mangoo@wpkg.org>
Diffstat (limited to 'Detail.c')
-rw-r--r--Detail.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Detail.c b/Detail.c
index 3d6b10fd..5116ccac 100644
--- a/Detail.c
+++ b/Detail.c
@@ -409,7 +409,7 @@ int Detail(char *dev, int brief, int export, int test, char *homehost)
#if 0
This is pretty boring
printf(" Reshape pos'n : %llu%s\n", (unsigned long long) info.reshape_progress<<9,
- human_size(info.reshape_progress<<9));
+ human_size((unsigned long long)info.reshape_progress<<9));
#endif
if (info.delta_disks > 0)
printf(" Delta Devices : %d, (%d->%d)\n",