On Sat, 2025-04-19 at 13:28 -0400, cel@xxxxxxxxxx wrote: > From: Chuck Lever <chuck.lever@xxxxxxxxxx> > > A backchannel service might use forechannel send and receive > buffers, but svc_recv() still calls svc_alloc_arg() on backchannel > svc_rqsts, so it will populate the svc_rqst's rq_pages[] array > anyway. The "is backchannel" check in svc_init_buffer() saves us > nothing. > > In a moment, I plan to replace the rq_pages[] array with a > dynamically-allocated piece of memory, and svc_init_buffer() is > where that memory will get allocated. Backchannel requests actually > do use that array, so it has to be available to handle those > requests without a segfault. > > XXX: Or, make svc_alloc_arg() ignore backchannel requests too? > Could set rqstp->rq_maxpages to zero. > Maybe I'm confused here, but the backchannel still needs some pages to do its thing? I guess the main change here is that the pages are allocated at svc_create time instead of waiting until later? > Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx> > --- > net/sunrpc/svc.c | 4 ---- > 1 file changed, 4 deletions(-) > > diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c > index e7f9c295d13c..8ce3e6b3df6a 100644 > --- a/net/sunrpc/svc.c > +++ b/net/sunrpc/svc.c > @@ -640,10 +640,6 @@ svc_init_buffer(struct svc_rqst *rqstp, unsigned int size, int node) > { > unsigned long pages, ret; > > - /* bc_xprt uses fore channel allocated buffers */ > - if (svc_is_backchannel(rqstp)) > - return true; > - > pages = size / PAGE_SIZE + 1; /* extra page as we hold both request and reply. > * We assume one is at most one page > */ Acked-by: Jeff Layton <jlayton@xxxxxxxxxx>