mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-10 07:00:48 +00:00
xprtrdma: Remove BUG_ON() call sites
If an error occurs in the marshaling logic, fail the RPC request being processed, but leave the client running. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
This commit is contained in:
parent
e7ce710a88
commit
c977dea227
@ -463,7 +463,8 @@ xprt_rdma_allocate(struct rpc_task *task, size_t size)
|
||||
struct rpcrdma_req *req, *nreq;
|
||||
|
||||
req = rpcrdma_buffer_get(&rpcx_to_rdmax(xprt)->rx_buf);
|
||||
BUG_ON(NULL == req);
|
||||
if (req == NULL)
|
||||
return NULL;
|
||||
|
||||
if (size > req->rl_size) {
|
||||
dprintk("RPC: %s: size %zd too large for buffer[%zd]: "
|
||||
|
@ -1302,7 +1302,6 @@ rpcrdma_buffer_put(struct rpcrdma_req *req)
|
||||
int i;
|
||||
unsigned long flags;
|
||||
|
||||
BUG_ON(req->rl_nchunks != 0);
|
||||
spin_lock_irqsave(&buffers->rb_lock, flags);
|
||||
buffers->rb_send_bufs[--buffers->rb_send_index] = req;
|
||||
req->rl_niovs = 0;
|
||||
@ -1535,10 +1534,6 @@ rpcrdma_register_frmr_external(struct rpcrdma_mr_seg *seg,
|
||||
} else
|
||||
post_wr = &frmr_wr;
|
||||
|
||||
/* Bump the key */
|
||||
key = (u8)(seg1->mr_chunk.rl_mw->r.frmr.fr_mr->rkey & 0x000000FF);
|
||||
ib_update_fast_reg_key(seg1->mr_chunk.rl_mw->r.frmr.fr_mr, ++key);
|
||||
|
||||
/* Prepare FRMR WR */
|
||||
memset(&frmr_wr, 0, sizeof frmr_wr);
|
||||
frmr_wr.wr_id = (unsigned long)(void *)seg1->mr_chunk.rl_mw;
|
||||
@ -1549,7 +1544,16 @@ rpcrdma_register_frmr_external(struct rpcrdma_mr_seg *seg,
|
||||
frmr_wr.wr.fast_reg.page_list_len = page_no;
|
||||
frmr_wr.wr.fast_reg.page_shift = PAGE_SHIFT;
|
||||
frmr_wr.wr.fast_reg.length = page_no << PAGE_SHIFT;
|
||||
BUG_ON(frmr_wr.wr.fast_reg.length < len);
|
||||
if (frmr_wr.wr.fast_reg.length < len) {
|
||||
while (seg1->mr_nsegs--)
|
||||
rpcrdma_unmap_one(ia, seg++);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
/* Bump the key */
|
||||
key = (u8)(seg1->mr_chunk.rl_mw->r.frmr.fr_mr->rkey & 0x000000FF);
|
||||
ib_update_fast_reg_key(seg1->mr_chunk.rl_mw->r.frmr.fr_mr, ++key);
|
||||
|
||||
frmr_wr.wr.fast_reg.access_flags = (writing ?
|
||||
IB_ACCESS_REMOTE_WRITE | IB_ACCESS_LOCAL_WRITE :
|
||||
IB_ACCESS_REMOTE_READ);
|
||||
@ -1709,9 +1713,7 @@ rpcrdma_deregister_external(struct rpcrdma_mr_seg *seg,
|
||||
|
||||
#if RPCRDMA_PERSISTENT_REGISTRATION
|
||||
case RPCRDMA_ALLPHYSICAL:
|
||||
BUG_ON(nsegs != 1);
|
||||
rpcrdma_unmap_one(ia, seg);
|
||||
rc = 0;
|
||||
break;
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user