diff options
author | Lars Ellenberg <lars.ellenberg@linbit.com> | 2010-11-09 08:12:10 -0500 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2011-03-10 05:19:04 -0500 |
commit | 18edc0b9d7dac2f74117a0bdb98f2e705eb74d82 (patch) | |
tree | 046016ff1349564bbd77d94212e4689bd0af5390 /drivers/block/drbd/drbd_proc.c | |
parent | 2649f0809f55e4df98c333a2b85c6fc8fee04804 (diff) |
drbd: fix potential wrap of 32bit oos:%lu display in /proc/drbd
When converting bits (4k resolution, still) to kB, we shift left. If it
was a large number of bits on a 32bit box (>= 4 TiB storage), we may
wrap the 32bit unsigned long base type, resulting in incorrect display.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_proc.c')
-rw-r--r-- | drivers/block/drbd/drbd_proc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/block/drbd/drbd_proc.c b/drivers/block/drbd/drbd_proc.c index fab3fde3477..07368b75392 100644 --- a/drivers/block/drbd/drbd_proc.c +++ b/drivers/block/drbd/drbd_proc.c | |||
@@ -259,8 +259,9 @@ static int drbd_seq_show(struct seq_file *seq, void *v) | |||
259 | mdev->epochs, | 259 | mdev->epochs, |
260 | write_ordering_chars[mdev->write_ordering] | 260 | write_ordering_chars[mdev->write_ordering] |
261 | ); | 261 | ); |
262 | seq_printf(seq, " oos:%lu\n", | 262 | seq_printf(seq, " oos:%llu\n", |
263 | Bit2KB(drbd_bm_total_weight(mdev))); | 263 | Bit2KB((unsigned long long) |
264 | drbd_bm_total_weight(mdev))); | ||
264 | } | 265 | } |
265 | if (mdev->state.conn == C_SYNC_SOURCE || | 266 | if (mdev->state.conn == C_SYNC_SOURCE || |
266 | mdev->state.conn == C_SYNC_TARGET || | 267 | mdev->state.conn == C_SYNC_TARGET || |