From 7fb8c702f250b9ed4fe59269bb6f0815d05f0cc1 Mon Sep 17 00:00:00 2001 From: Chuck Fossen Date: Thu, 26 Apr 2018 15:04:25 -0500 Subject: [PATCH] LU-10963 gnilnd: stats variables overflow assert Reverse bte rdma transactions stats were being incremented by kgnilnd_admin_addref() which asserts when the value goes negative. These stats should be incremented with atomic_inc instead. Test-Parameters: trivial Cray-bug-id: LUS-5940 Signed-off-by: Chuck Fossen Change-Id: I06426bc078cc76f14c7b3efb5f3ceb71054c2d09 Reviewed-on: https://review.whamcloud.com/32184 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- lnet/klnds/gnilnd/gnilnd_cb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lnet/klnds/gnilnd/gnilnd_cb.c b/lnet/klnds/gnilnd/gnilnd_cb.c index 8afce81..89f8bd2 100644 --- a/lnet/klnds/gnilnd/gnilnd_cb.c +++ b/lnet/klnds/gnilnd/gnilnd_cb.c @@ -1914,11 +1914,11 @@ kgnilnd_rdma(kgn_tx_t *tx, int type, tx->tx_offset = ((__u64)((unsigned long)sink->gnrd_addr)) & 3; if (tx->tx_offset) - kgnilnd_admin_addref(kgnilnd_data.kgn_rev_offset); + atomic_inc(&kgnilnd_data.kgn_rev_offset); if ((nob + tx->tx_offset) & 3) { desc_nob = ((nob + tx->tx_offset) + (4 - ((nob + tx->tx_offset) & 3))); - kgnilnd_admin_addref(kgnilnd_data.kgn_rev_length); + atomic_inc(&kgnilnd_data.kgn_rev_length); } else { desc_nob = (nob + tx->tx_offset); } @@ -1934,7 +1934,7 @@ kgnilnd_rdma(kgn_tx_t *tx, int type, kgnilnd_tx_done(tx, -EFAULT); return 0; } - kgnilnd_admin_addref(kgnilnd_data.kgn_rev_copy_buff); + atomic_inc(&kgnilnd_data.kgn_rev_copy_buff); rc = kgnilnd_mem_register(conn->gnc_device->gnd_handle, (__u64)tx->tx_buffer_copy, desc_nob, NULL, GNI_MEM_READWRITE, &tx->tx_buffer_copy_map_key); if (rc != GNI_RC_SUCCESS) { /* Registration Failed nak rdma and kill the tx. */ -- 1.8.3.1