RE: [kbuild] Re: [PATCH for-next v4 10/10] RDMA/rxe: Disallow MR dereg and invalidate when bound

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



That's the problem with coding in the middle of the night. Thanks. Bob

-----Original Message-----
From: Dan Carpenter <dan.carpenter@xxxxxxxxxx> 
Sent: Thursday, April 22, 2021 5:42 AM
To: kbuild@xxxxxxxxxxxx; Bob Pearson <rpearsonhpe@xxxxxxxxx>; jgg@xxxxxxxxxx; zyjzyj2000@xxxxxxxxx; linux-rdma@xxxxxxxxxxxxxxx
Cc: lkp@xxxxxxxxx; kbuild-all@xxxxxxxxxxxx; Pearson, Robert B <robert.pearson2@xxxxxxx>
Subject: [kbuild] Re: [PATCH for-next v4 10/10] RDMA/rxe: Disallow MR dereg and invalidate when bound

Hi Bob,

url:    https://github.com/0day-ci/linux/commits/Bob-Pearson/RDMA-rxe-Implement-memory-windows/20210422-132958
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git  for-next
config: x86_64-randconfig-m001-20210421 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

smatch warnings:
drivers/infiniband/sw/rxe/rxe_mr.c:553 rxe_invalidate_mr() warn: ignoring unreachable code.

vim +553 drivers/infiniband/sw/rxe/rxe_mr.c

5f1e7f44d3a9cdb Bob Pearson 2021-04-22  529  int rxe_invalidate_mr(struct rxe_qp *qp, u32 rkey) 5f1e7f44d3a9cdb Bob Pearson 2021-04-22  530  {
5f1e7f44d3a9cdb Bob Pearson 2021-04-22  531  	struct rxe_dev *rxe = to_rdev(qp->ibqp.device);
5f1e7f44d3a9cdb Bob Pearson 2021-04-22  532  	struct rxe_mr *mr;
5f1e7f44d3a9cdb Bob Pearson 2021-04-22  533  	int ret;
5f1e7f44d3a9cdb Bob Pearson 2021-04-22  534  
5f1e7f44d3a9cdb Bob Pearson 2021-04-22  535  	mr = rxe_pool_get_index(&rxe->mr_pool, rkey >> 8);
5f1e7f44d3a9cdb Bob Pearson 2021-04-22  536  	if (!mr) {
5f1e7f44d3a9cdb Bob Pearson 2021-04-22  537  		pr_err("%s: No MR for rkey %#x\n", __func__, rkey);
5f1e7f44d3a9cdb Bob Pearson 2021-04-22  538  		ret = -EINVAL;
5f1e7f44d3a9cdb Bob Pearson 2021-04-22  539  		goto err;
5f1e7f44d3a9cdb Bob Pearson 2021-04-22  540  	}
5f1e7f44d3a9cdb Bob Pearson 2021-04-22  541  
5f1e7f44d3a9cdb Bob Pearson 2021-04-22  542  	if (rkey != mr->ibmr.rkey) {
5f1e7f44d3a9cdb Bob Pearson 2021-04-22  543  		pr_err("%s: rkey (%#x) doesn't match mr->ibmr.rkey (%#x)\n",
5f1e7f44d3a9cdb Bob Pearson 2021-04-22  544  			__func__, rkey, mr->ibmr.rkey);
5f1e7f44d3a9cdb Bob Pearson 2021-04-22  545  		ret = -EINVAL;
5f1e7f44d3a9cdb Bob Pearson 2021-04-22  546  		goto err_drop_ref;
5f1e7f44d3a9cdb Bob Pearson 2021-04-22  547  	}
5f1e7f44d3a9cdb Bob Pearson 2021-04-22  548  
740526f943e87ee Bob Pearson 2021-04-22  549  	if (atomic_read(&mr->num_mw) > 0) {
740526f943e87ee Bob Pearson 2021-04-22  550  		pr_warn("%s: Attempt to invalidate an MR while bound to MWs\n",
740526f943e87ee Bob Pearson 2021-04-22  551  				__func__);
740526f943e87ee Bob Pearson 2021-04-22  552  		return -EINVAL;
740526f943e87ee Bob Pearson 2021-04-22 @553  		goto err_drop_ref;

Either the goto or the return should be deleted.  I would have expected that it would be the return to be deleted, otherwise it needs a big comment why we're holding on to the reference.

740526f943e87ee Bob Pearson 2021-04-22  554  	}
740526f943e87ee Bob Pearson 2021-04-22  555  
5f1e7f44d3a9cdb Bob Pearson 2021-04-22  556  	mr->state = RXE_MR_STATE_FREE;
5f1e7f44d3a9cdb Bob Pearson 2021-04-22  557  	ret = 0;
5f1e7f44d3a9cdb Bob Pearson 2021-04-22  558 5f1e7f44d3a9cdb Bob Pearson 2021-04-22  559  err_drop_ref:
5f1e7f44d3a9cdb Bob Pearson 2021-04-22  560  	rxe_drop_ref(mr);
5f1e7f44d3a9cdb Bob Pearson 2021-04-22  561  err:
5f1e7f44d3a9cdb Bob Pearson 2021-04-22  562  	return ret;
5f1e7f44d3a9cdb Bob Pearson 2021-04-22  563  }

---
0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx 




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux