From: Or Gerlitz Date: Mon, 1 Aug 2011 21:12:09 +0000 (+0000) Subject: IBiser: Fix wrong mask when sizeof (dma_addr_t) > sizeof (unsigned long) X-Git-Tag: MMI-PSA29.97-13-9~18541^2^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0ace64b85ea7b90e3bffe408b9d7c3364692bfa4;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git IBiser: Fix wrong mask when sizeof (dma_addr_t) > sizeof (unsigned long) The code that prepares the SG associated with SCSI command for FMR was buggy for systems with DMA addresses that don't fit in unsigned long, e.g under the 32-bit based XenServer dom0 sizeof(dma_addr_t) is 8. Fix that by casting to unsigned long long a masking constant used by the code. This resolves a crash in iser_sg_to_page_vec on this system. Signed-off-by: Or Gerlitz Signed-off-by: Roland Dreier --- diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h index 342cbc1bdaae..db6f3ce9f3bf 100644 --- a/drivers/infiniband/ulp/iser/iscsi_iser.h +++ b/drivers/infiniband/ulp/iser/iscsi_iser.h @@ -89,7 +89,7 @@ } while (0) #define SHIFT_4K 12 -#define SIZE_4K (1UL << SHIFT_4K) +#define SIZE_4K (1ULL << SHIFT_4K) #define MASK_4K (~(SIZE_4K-1)) /* support up to 512KB in one RDMA */