Unverified Commit 42711608 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!1925 [sync] PR-1883: SUNRPC: don't pause on incomplete allocation

parents c645b901 e680868c
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -643,7 +643,7 @@ static int svc_alloc_arg(struct svc_rqst *rqstp)
{
	struct svc_serv *serv = rqstp->rq_server;
	struct xdr_buf *arg = &rqstp->rq_arg;
	unsigned long pages, filled;
	unsigned long pages, filled, ret;

	pages = (serv->sv_max_mesg + 2 * PAGE_SIZE) >> PAGE_SHIFT;
	if (pages > RPCSVC_MAXPAGES) {
@@ -653,11 +653,12 @@ static int svc_alloc_arg(struct svc_rqst *rqstp)
		pages = RPCSVC_MAXPAGES;
	}

	for (;;) {
		filled = alloc_pages_bulk_array(GFP_KERNEL, pages,
	for (filled = 0; filled < pages; filled = ret) {
		ret = alloc_pages_bulk_array(GFP_KERNEL, pages,
					     rqstp->rq_pages);
		if (filled == pages)
			break;
		if (ret > filled)
			/* Made progress, don't sleep yet */
			continue;

		set_current_state(TASK_INTERRUPTIBLE);
		if (signalled() || kthread_should_stop()) {