blktrace: Fix replay_align 32 bit truncation
authorSitsofe Wheeler <sitsofe@yahoo.com>
Sat, 3 Dec 2016 09:31:34 +0000 (09:31 +0000)
committerSitsofe Wheeler <sitsofe@yahoo.com>
Mon, 12 Dec 2016 22:23:28 +0000 (22:23 +0000)
When using replay_align the aligned offset was truncated when the
original offset was greater than 2^32. Fix this by forcing the
calculation to happen with 64 bits.

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
blktrace.c

index deb8b2d6d68eb465b1929fd9565cde900d9b408c..dcddd4f21b15e322ef2796d319734c4fb94a5b2a 100644 (file)
@@ -221,7 +221,7 @@ static void ipo_bytes_align(struct thread_options *o, struct io_piece *ipo)
        if (!o->replay_align)
                return;
 
-       ipo->offset &= ~(o->replay_align - 1);
+       ipo->offset &= ~(o->replay_align - (uint64_t)1);
 }