| From 58e5546fe178e53b2a637a4355cac52b1fc29cc4 Mon Sep 17 00:00:00 2001 |
| From: Jiewei Ke <kejiewei.cn@gmail.com> |
| Date: Fri, 27 Dec 2019 19:36:13 +0800 |
| Subject: [PATCH] RDMA/rxe: Fix error type of mmap_offset |
| |
| commit 6ca18d8927d468c763571f78c9a7387a69ffa020 upstream. |
| |
| The type of mmap_offset should be u64 instead of int to match the type of |
| mminfo.offset. If otherwise, after we create several thousands of CQs, it |
| will run into overflow issues. |
| |
| Link: https://lore.kernel.org/r/20191227113613.5020-1-kejiewei.cn@gmail.com |
| Signed-off-by: Jiewei Ke <kejiewei.cn@gmail.com> |
| Reviewed-by: Jason Gunthorpe <jgg@mellanox.com> |
| Signed-off-by: Jason Gunthorpe <jgg@mellanox.com> |
| Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> |
| |
| diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.h b/drivers/infiniband/sw/rxe/rxe_verbs.h |
| index 28bfb3ece104..3536ab43eed3 100644 |
| --- a/drivers/infiniband/sw/rxe/rxe_verbs.h |
| +++ b/drivers/infiniband/sw/rxe/rxe_verbs.h |
| @@ -407,7 +407,7 @@ struct rxe_dev { |
| struct list_head pending_mmaps; |
| |
| spinlock_t mmap_offset_lock; /* guard mmap_offset */ |
| - int mmap_offset; |
| + u64 mmap_offset; |
| |
| atomic64_t stats_counters[RXE_NUM_OF_COUNTERS]; |
| |
| -- |
| 2.7.4 |
| |