File 0001-libpmemblk-cast-translation-entry-to-uint64_t-when-calculating-data-offset.patch of Package nvml
From: Brian Boylston <brian.boylston@hpe.com>
Date: Tue, 14 Jun 2016 09:31:29 -0500
Subject: libpmemblk: cast translation entry to uint64_t when calculating data offset
Git-repo: http://github.com/pmem/nvml.git
Git-commit: 81a4e5e472f6ec74b6f2cda160a90e6488ae30ce
References: bsc#986657
Acked-by: Johannes Thumshirn <jthumshirn@suse.com>
---
src/libpmemblk/btt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/libpmemblk/btt.c b/src/libpmemblk/btt.c
index af8c3f3..08e5c31 100644
--- a/src/libpmemblk/btt.c
+++ b/src/libpmemblk/btt.c
@@ -1583,7 +1583,7 @@ btt_read(struct btt *bttp, unsigned lane, uint64_t lba, void *buf)
* block from getting re-allocated to something else by a write.
*/
uint64_t data_block_off =
- arenap->dataoff + (entry & BTT_MAP_ENTRY_LBA_MASK) *
+ arenap->dataoff + (uint64_t)(entry & BTT_MAP_ENTRY_LBA_MASK) *
arenap->internal_lbasize;
int readret = (*bttp->ns_cbp->nsread)(bttp->ns, lane, buf,
bttp->lbasize, data_block_off);
@@ -1748,7 +1748,7 @@ btt_write(struct btt *bttp, unsigned lane, uint64_t lba, const void *buf)
/* it is now safe to perform write to the free block */
uint64_t data_block_off = arenap->dataoff +
- (free_entry & BTT_MAP_ENTRY_LBA_MASK) *
+ (uint64_t)(free_entry & BTT_MAP_ENTRY_LBA_MASK) *
arenap->internal_lbasize;
if ((*bttp->ns_cbp->nswrite)(bttp->ns, lane, buf,
bttp->lbasize, data_block_off) < 0)