Skip to content

Commit

Permalink
IBiser: Fix wrong mask when sizeof (dma_addr_t) > sizeof (unsigned long)
Browse files Browse the repository at this point in the history
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 <ogerlitz@mellanox.co.il>
Signed-off-by: Roland Dreier <roland@purestorage.com>
  • Loading branch information
Or Gerlitz authored and Roland Dreier committed Aug 17, 2011
1 parent 322a8b0 commit 0ace64b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/infiniband/ulp/iser/iscsi_iser.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 0ace64b

Please sign in to comment.