Skip to content

Commit f2f80ac

Browse files
committed
Merge tag 'nfsd-6.9-2' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux
Pull nfsd fixes from Chuck Lever: - Address a slow memory leak with RPC-over-TCP - Prevent another NFS4ERR_DELAY loop during CREATE_SESSION * tag 'nfsd-6.9-2' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: nfsd: hold a lighter-weight client reference over CB_RECALL_ANY SUNRPC: Fix a slow server-side memory leak with RPC-over-TCP
2 parents cf17b95 + 10396f4 commit f2f80ac

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

fs/nfsd/nfs4state.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3042,12 +3042,9 @@ static void
30423042
nfsd4_cb_recall_any_release(struct nfsd4_callback *cb)
30433043
{
30443044
struct nfs4_client *clp = cb->cb_clp;
3045-
struct nfsd_net *nn = net_generic(clp->net, nfsd_net_id);
30463045

3047-
spin_lock(&nn->client_lock);
30483046
clear_bit(NFSD4_CLIENT_CB_RECALL_ANY, &clp->cl_flags);
3049-
put_client_renew_locked(clp);
3050-
spin_unlock(&nn->client_lock);
3047+
drop_client(clp);
30513048
}
30523049

30533050
static int
@@ -6616,7 +6613,7 @@ deleg_reaper(struct nfsd_net *nn)
66166613
list_add(&clp->cl_ra_cblist, &cblist);
66176614

66186615
/* release in nfsd4_cb_recall_any_release */
6619-
atomic_inc(&clp->cl_rpc_users);
6616+
kref_get(&clp->cl_nfsdfs.cl_ref);
66206617
set_bit(NFSD4_CLIENT_CB_RECALL_ANY, &clp->cl_flags);
66216618
clp->cl_ra_time = ktime_get_boottime_seconds();
66226619
}

net/sunrpc/svcsock.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,15 +1206,6 @@ static int svc_tcp_recvfrom(struct svc_rqst *rqstp)
12061206
* MSG_SPLICE_PAGES is used exclusively to reduce the number of
12071207
* copy operations in this path. Therefore the caller must ensure
12081208
* that the pages backing @xdr are unchanging.
1209-
*
1210-
* Note that the send is non-blocking. The caller has incremented
1211-
* the reference count on each page backing the RPC message, and
1212-
* the network layer will "put" these pages when transmission is
1213-
* complete.
1214-
*
1215-
* This is safe for our RPC services because the memory backing
1216-
* the head and tail components is never kmalloc'd. These always
1217-
* come from pages in the svc_rqst::rq_pages array.
12181209
*/
12191210
static int svc_tcp_sendmsg(struct svc_sock *svsk, struct svc_rqst *rqstp,
12201211
rpc_fraghdr marker, unsigned int *sentp)
@@ -1244,6 +1235,7 @@ static int svc_tcp_sendmsg(struct svc_sock *svsk, struct svc_rqst *rqstp,
12441235
iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, rqstp->rq_bvec,
12451236
1 + count, sizeof(marker) + rqstp->rq_res.len);
12461237
ret = sock_sendmsg(svsk->sk_sock, &msg);
1238+
page_frag_free(buf);
12471239
if (ret < 0)
12481240
return ret;
12491241
*sentp += ret;

0 commit comments

Comments
 (0)