Skip to content

Commit 196c699

Browse files
Shirley Maamschuma-ntap
authored andcommitted
xprtrdma: Allocate missing pagelist
GETACL relies on transport layer to alloc memory for reply buffer. However xprtrdma assumes that the reply buffer (pagelist) has been pre-allocated in upper layer. This problem was reported by IOL OFA lab test on PPC. Signed-off-by: Shirley Ma <shirley.ma@oracle.com> Reviewed-by: Chuck Lever <chuck.lever@oracle.com> Tested-by: Edward Mossman <emossman@iol.unh.edu> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
1 parent 5bc4bc7 commit 196c699

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

net/sunrpc/xprtrdma/rpc_rdma.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ rpcrdma_convert_iovs(struct xdr_buf *xdrbuf, unsigned int pos,
9999
page_base = xdrbuf->page_base & ~PAGE_MASK;
100100
p = 0;
101101
while (len && n < nsegs) {
102+
if (!ppages[p]) {
103+
/* alloc the pagelist for receiving buffer */
104+
ppages[p] = alloc_page(GFP_ATOMIC);
105+
if (!ppages[p])
106+
return 0;
107+
}
102108
seg[n].mr_page = ppages[p];
103109
seg[n].mr_offset = (void *)(unsigned long) page_base;
104110
seg[n].mr_len = min_t(u32, PAGE_SIZE - page_base, len);

0 commit comments

Comments
 (0)