Skip to content

Commit 91f8ce2

Browse files
committed
svcrdma: Convert "might sleep" comment into a code annotation
Try to catch incorrect calling contexts mechanically rather than by code review. Reviewed-by: Jeff Layton <jlayton@kernel.org> Acked-by: Tom Talpey <tom@talpey.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent 2621767 commit 91f8ce2

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

net/sunrpc/xprtrdma/svc_rdma_rw.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,7 @@ static void svc_rdma_wc_read_done(struct ib_cq *cq, struct ib_wc *wc)
353353
return;
354354
}
355355

356-
/* This function sleeps when the transport's Send Queue is congested.
357-
*
356+
/*
358357
* Assumptions:
359358
* - If ib_post_send() succeeds, only one completion is expected,
360359
* even if one or more WRs are flushed. This is true when posting
@@ -369,6 +368,8 @@ static int svc_rdma_post_chunk_ctxt(struct svc_rdma_chunk_ctxt *cc)
369368
struct ib_cqe *cqe;
370369
int ret;
371370

371+
might_sleep();
372+
372373
if (cc->cc_sqecount > rdma->sc_sq_depth)
373374
return -EINVAL;
374375

net/sunrpc/xprtrdma/svc_rdma_sendto.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,8 @@ int svc_rdma_send(struct svcxprt_rdma *rdma, struct svc_rdma_send_ctxt *ctxt)
315315
struct ib_send_wr *wr = &ctxt->sc_send_wr;
316316
int ret;
317317

318+
might_sleep();
319+
318320
/* Sync the transport header buffer */
319321
ib_dma_sync_single_for_device(rdma->sc_pd->device,
320322
wr->sg_list[0].addr,

0 commit comments

Comments
 (0)