Skip to content

Commit 14e2bc4

Browse files
committed
Merge tag 'nfsd-5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux
Pull nfsd fixes from Chuck Lever: - Restore performance on memory-starved servers * tag 'nfsd-5.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: SUNRPC: improve error response to over-size gss credential SUNRPC: don't pause on incomplete allocation
2 parents 8a05abd + 0c217d5 commit 14e2bc4

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

net/sunrpc/auth_gss/svcauth_gss.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ static void rsi_request(struct cache_detail *cd,
194194
qword_addhex(bpp, blen, rsii->in_handle.data, rsii->in_handle.len);
195195
qword_addhex(bpp, blen, rsii->in_token.data, rsii->in_token.len);
196196
(*bpp)[-1] = '\n';
197+
WARN_ONCE(*blen < 0,
198+
"RPCSEC/GSS credential too large - please use gssproxy\n");
197199
}
198200

199201
static int rsi_parse(struct cache_detail *cd,

net/sunrpc/cache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ static int cache_request(struct cache_detail *detail,
803803

804804
detail->cache_request(detail, crq->item, &bp, &len);
805805
if (len < 0)
806-
return -EAGAIN;
806+
return -E2BIG;
807807
return PAGE_SIZE - len;
808808
}
809809

net/sunrpc/svc_xprt.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ static int svc_alloc_arg(struct svc_rqst *rqstp)
663663
{
664664
struct svc_serv *serv = rqstp->rq_server;
665665
struct xdr_buf *arg = &rqstp->rq_arg;
666-
unsigned long pages, filled;
666+
unsigned long pages, filled, ret;
667667

668668
pagevec_init(&rqstp->rq_pvec);
669669

@@ -675,11 +675,12 @@ static int svc_alloc_arg(struct svc_rqst *rqstp)
675675
pages = RPCSVC_MAXPAGES;
676676
}
677677

678-
for (;;) {
679-
filled = alloc_pages_bulk_array(GFP_KERNEL, pages,
680-
rqstp->rq_pages);
681-
if (filled == pages)
682-
break;
678+
for (filled = 0; filled < pages; filled = ret) {
679+
ret = alloc_pages_bulk_array(GFP_KERNEL, pages,
680+
rqstp->rq_pages);
681+
if (ret > filled)
682+
/* Made progress, don't sleep yet */
683+
continue;
683684

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

0 commit comments

Comments
 (0)