Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4588368rdb; Tue, 12 Dec 2023 04:07:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IFwX/rM5Ej1YIwh+v0aFefYtwMs6BKLVT1JlWLMAID497f07hcSEuASEqGdLaEpZ0h+E3iI X-Received: by 2002:a05:620a:45a6:b0:77d:e60b:4caa with SMTP id bp38-20020a05620a45a600b0077de60b4caamr7587961qkb.35.1702382862503; Tue, 12 Dec 2023 04:07:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702382862; cv=none; d=google.com; s=arc-20160816; b=EzTa0IFw8eDP6dVW32pR0+LgReQmnzq4Hf03lcXR44g4rjF8fIkX88mfbhsoEO1Uu7 wXCi8Q8L4TlOxlONWGFxV0wbQKbnVpPzYqBxqREghk9XbUgz0aZCTpr3tUWTCus+5qWF gHkyKS/KQSFcd/hOw9oTejePRM3QR9YNO5X8yZbpBqwifeVGMQ1sxFhKbNVyl07jYqoB A787JoED2JMGjrmPpeYlXRGrk2cn4mQM2Ag0vCELs9+3bqHwb5LjX8AhTCD8y44RxgQM e4suoaZ0Ya9QFUumzoo+jkWJqhRUV6OM19+i6ZTMkNUigqDUwLr/QFGFyNz8dsPzvKhV PQow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:autocrypt:references :in-reply-to:date:cc:to:from:subject:message-id:dkim-signature; bh=4lN4mfPRh2gM+IqzufUMPWK05eLmC1+64iNADBkUR3g=; fh=Q4Lh0uPu9tUjkJMyjzd03VWHiqaJ7GyS1pXmTBEBkWE=; b=A4/nv1ict4KejFp7vJseTShI3W1vgUuq8aw3Lv2tzRVlC9Y6gqUfrF3SjFFP5gERGZ JL9SKv81lGm49UgFXGGsF6KCQAVRAgrAPkbcnjQaCtKoweMB+eq6KjWCcPOhHx+y/hf5 OG5mA1XsErD2dPzxGgm0vR+Tg0ijJ7rjShbXWbAM3N+VQw44p3EiT3O/NRmIrmlIE4/Z 3VZEPpaP5Ax7EL2kNOoRVr20jr5RY8HPQlnGf+VAWk0PSxT5e5roInNRyFDlR7MBX8SH IzlwvxqYa75Ds5IlEnqrRSC0xhNnOtsztu073Gi78fx77WR3oXX2jucgGr/b9OM8dz0M N2NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LzzDIFwg; spf=pass (google.com: domain of linux-nfs+bounces-503-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-503-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id i9-20020a05620a0a0900b0077da7c84a50si9588201qka.5.2023.12.12.04.07.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 04:07:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-503-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LzzDIFwg; spf=pass (google.com: domain of linux-nfs+bounces-503-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-503-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 24A2F1C20A9F for ; Tue, 12 Dec 2023 12:07:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 748505DF39; Tue, 12 Dec 2023 12:07:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LzzDIFwg" X-Original-To: linux-nfs@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4FC265DF2B; Tue, 12 Dec 2023 12:07:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38151C433C9; Tue, 12 Dec 2023 12:07:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702382859; bh=7IRFdDszJVM8mzDADIBnyb2aIaH4ey6cj/wiRKd5x0o=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=LzzDIFwgLRdA24nKz1A7+1oLjzInxMKnPwYFcla+VoSlZ9wV+y5KFBRYscRY3gucU VeXD2MYwrjq/81HXtGw5MdvAqBBiPvjq6aVQaNQCHHwhVnM+SsZEDDZ0eftmw3G+VW bFkjITLUfrj6sTdRez73z4e5s4TPP4fGwld5iaVcK5zrZdUKAGrFhbkJIohVHykHjE LJz5qJG6r4gawxGts+lJQQGnMJ0CUdpeV0jVyCDDYEHOiHuqeGjn7VcIR0KjyGX0P0 +zaj5S1a3wmoH+K19BGKeJBA2hDKMCxPFeWVhktfZsHbR61q9QFc1lX7pPXQbDHae3 jLeqCeLnSFdVA== Message-ID: <5d9bbb599569ce29f16e4e0eef6b291eda0f375b.camel@kernel.org> Subject: Re: [PATCH v8 3/3] NFSD: add rpc_status netlink support From: Jeff Layton To: Lorenzo Bianconi , linux-nfs@vger.kernel.org Cc: lorenzo.bianconi@redhat.com, chuck.lever@oracle.com, neilb@suse.de, netdev@vger.kernel.org Date: Tue, 12 Dec 2023 07:07:37 -0500 In-Reply-To: References: Autocrypt: addr=jlayton@kernel.org; prefer-encrypt=mutual; keydata=mQINBE6V0TwBEADXhJg7s8wFDwBMEvn0qyhAnzFLTOCHooMZyx7XO7dAiIhDSi7G1NPxwn8jdFUQMCR/GlpozMFlSFiZXiObE7sef9rTtM68ukUyZM4pJ9l0KjQNgDJ6Fr342Htkjxu/kFV1WvegyjnSsFt7EGoDjdKqr1TS9syJYFjagYtvWk/UfHlW09X+jOh4vYtfX7iYSx/NfqV3W1D7EDi0PqVT2h6v8i8YqsATFPwO4nuiTmL6I40ZofxVd+9wdRI4Db8yUNA4ZSP2nqLcLtFjClYRBoJvRWvsv4lm0OX6MYPtv76hka8lW4mnRmZqqx3UtfHX/hF/zH24Gj7A6sYKYLCU3YrI2Ogiu7/ksKcl7goQjpvtVYrOOI5VGLHge0awt7bhMCTM9KAfPc+xL/ZxAMVWd3NCk5SamL2cE99UWgtvNOIYU8m6EjTLhsj8snVluJH0/RcxEeFbnSaswVChNSGa7mXJrTR22lRL6ZPjdMgS2Km90haWPRc8Wolcz07Y2se0xpGVLEQcDEsvv5IMmeMe1/qLZ6NaVkNuL3WOXvxaVT9USW1+/SGipO2IpKJjeDZfehlB/kpfF24+RrK+seQfCBYyUE8QJpvTZyfUHNYldXlrjO6n5MdOempLqWpfOmcGkwnyNRBR46g/jf8KnPRwXs509yAqDB6sELZH+yWr9LQZEwARAQABtCVKZWZmIExheXRvbiA8amxheXRvbkBwb29jaGllcmVkcy5uZXQ+iQI7BBMBAgAlAhsDBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAUCTpXWPAIZAQAKCRAADmhBGVaCFc65D/4gBLNMHopQYgG/9RIM3kgFCCQV0pLv0hcg1cjr+bPI5f1PzJoOVi9s0wBDHwp8+vtHgYhM54yt43uI7Htij0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wwACgkQAA5oQRlWghXhZRAAyycZ2DDyXh2bMYvI8uHgCbeXfL3QCvcw2XoZTH2l2umPiTzrCsDJhgwZfG9BDyOHaYhPasd5qgrUBtjjUiNKjVM+Cx1DnieR0dZWafnqGv682avPblfi70XXr2juRE/fSZoZkyZhm+nsLuIcXTnzY4D572JGrpRMTpNpGmitBdh1l/9O7Fb64uLOtA5Qj5jcHHOjL0DZpjmFWYKlSAHmURHrE8M0qRryQXvlhoQxlJR4nvQrjOPMsqWD5F9mcRyowOzr8amasLv43w92rD2nHoBK6rbFE/qC7AAjABEsZq8+TQmueN0maIXUQu7TBzejsEbV0i29z+kkrjU2NmK5pcxgAtehVxpZJ14LqmN6E0suTtzjNT1eMoqOPrMSx+6vOCIuvJ/MVYnQgHhjtPPnU86mebTY5Loy9YfJAC2EVpxtcCbx2KiwErTndEyWL+GL53LuScUD7tW8vYbGIp4RlnUgPLbqpgssq2gwYO9m75FGuKuB2+2bCGajqalid5nzeq9v7cYLLRgArJfOIBWZrHy2m0C+pFu9DSuV6SNr2dvMQUv1V58h0FaSOxHVQnJdnoHn13g/CKKvyg2EMrMt/EfcXgvDwQbnG9we4xJiWOIOcsvrWcB6C6lWBDA+In7w7SXnnok kZWuOsJdJQdmwlWC5L5ln9xgfr/4mOY38B0U= Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.2 (3.50.2-1.fc39) Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Mon, 2023-12-11 at 13:56 -0500, Jeff Layton wrote: > On Mon, 2023-09-11 at 14:49 +0200, Lorenzo Bianconi wrote: > > Introduce rpc_status netlink support for NFSD in order to dump pending > > RPC requests debugging information from userspace. > >=20 > > Tested-by: Jeff Layton > > Signed-off-by: Lorenzo Bianconi > > --- > > fs/nfsd/nfsctl.c | 192 ++++++++++++++++++++++++++++++++++++- > > fs/nfsd/nfsd.h | 16 ++++ > > fs/nfsd/nfssvc.c | 15 +++ > > fs/nfsd/state.h | 2 - > > include/linux/sunrpc/svc.h | 1 + > > 5 files changed, 222 insertions(+), 4 deletions(-) > >=20 > > diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c > > index 1be66088849c..b862a759ea15 100644 > > --- a/fs/nfsd/nfsctl.c > > +++ b/fs/nfsd/nfsctl.c > > @@ -26,6 +26,7 @@ > > #include "pnfs.h" > > #include "filecache.h" > > #include "trace.h" > > +#include "nfs_netlink_gen.h" > > =20 > > /* > > * We have a single directory with several nodes in it. > > @@ -1497,17 +1498,199 @@ unsigned int nfsd_net_id; > > =20 > > int nfsd_server_nl_rpc_status_get_start(struct netlink_callback *cb) > > { > > - return 0; > > + struct nfsd_net *nn =3D net_generic(sock_net(cb->skb->sk), nfsd_net_i= d); > > + int ret =3D -ENODEV; > > + > > + mutex_lock(&nfsd_mutex); > > + if (nn->nfsd_serv) { > > + svc_get(nn->nfsd_serv); > > + ret =3D 0; > > + } > > + mutex_unlock(&nfsd_mutex); > > + > > + return ret; > > } >=20 > I think there is a potential race above. Once you've dropped the > nfsd_mutex, there is no guarantee that the nn->nfsd_serv will still be > set when you come back to put the serv. That means that we could oops > when we hit the _done method below. >=20 > Is it possible to stash a pointer to the serv while we hold the > reference? >=20 Actually, it looks like Neil may have already fixed this in the series he sent on Oct 29th. See: [PATCH 3/5] nfsd: hold nfsd_mutex across entire netlink operation Another reason to go ahead and get that series in... > > =20 > > -int nfsd_server_nl_rpc_status_get_done(struct netlink_callback *cb) > > +static int nfsd_genl_rpc_status_compose_msg(struct sk_buff *skb, > > + struct netlink_callback *cb, > > + struct nfsd_genl_rqstp *rqstp) > > { > > + void *hdr; > > + int i; > > + > > + hdr =3D genlmsg_put(skb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_s= eq, > > + &nfsd_server_nl_family, NLM_F_MULTI, > > + NFSD_CMD_RPC_STATUS_GET); > > + if (!hdr) > > + return -ENOBUFS; > > + > > + if (nla_put_be32(skb, NFSD_ATTR_RPC_STATUS_XID, rqstp->rq_xid) || > > + nla_put_u32(skb, NFSD_ATTR_RPC_STATUS_FLAGS, rqstp->rq_flags) || > > + nla_put_u32(skb, NFSD_ATTR_RPC_STATUS_PROG, rqstp->rq_prog) || > > + nla_put_u32(skb, NFSD_ATTR_RPC_STATUS_PROC, rqstp->rq_proc) || > > + nla_put_u8(skb, NFSD_ATTR_RPC_STATUS_VERSION, rqstp->rq_vers) || > > + nla_put_s64(skb, NFSD_ATTR_RPC_STATUS_SERVICE_TIME, > > + ktime_to_us(rqstp->rq_stime), > > + NFSD_ATTR_RPC_STATUS_PAD)) > > + return -ENOBUFS; > > + > > + switch (rqstp->saddr.sa_family) { > > + case AF_INET: { > > + const struct sockaddr_in *s_in, *d_in; > > + > > + s_in =3D (const struct sockaddr_in *)&rqstp->saddr; > > + d_in =3D (const struct sockaddr_in *)&rqstp->daddr; > > + if (nla_put_in_addr(skb, NFSD_ATTR_RPC_STATUS_SADDR4, > > + s_in->sin_addr.s_addr) || > > + nla_put_in_addr(skb, NFSD_ATTR_RPC_STATUS_DADDR4, > > + d_in->sin_addr.s_addr) || > > + nla_put_be16(skb, NFSD_ATTR_RPC_STATUS_SPORT, > > + s_in->sin_port) || > > + nla_put_be16(skb, NFSD_ATTR_RPC_STATUS_DPORT, > > + d_in->sin_port)) > > + return -ENOBUFS; > > + break; > > + } > > + case AF_INET6: { > > + const struct sockaddr_in6 *s_in, *d_in; > > + > > + s_in =3D (const struct sockaddr_in6 *)&rqstp->saddr; > > + d_in =3D (const struct sockaddr_in6 *)&rqstp->daddr; > > + if (nla_put_in6_addr(skb, NFSD_ATTR_RPC_STATUS_SADDR6, > > + &s_in->sin6_addr) || > > + nla_put_in6_addr(skb, NFSD_ATTR_RPC_STATUS_DADDR6, > > + &d_in->sin6_addr) || > > + nla_put_be16(skb, NFSD_ATTR_RPC_STATUS_SPORT, > > + s_in->sin6_port) || > > + nla_put_be16(skb, NFSD_ATTR_RPC_STATUS_DPORT, > > + d_in->sin6_port)) > > + return -ENOBUFS; > > + break; > > + } > > + default: > > + break; > > + } > > + > > + if (rqstp->opcnt) { > > + struct nlattr *attr; > > + > > + attr =3D nla_nest_start(skb, NFSD_ATTR_RPC_STATUS_COMPOND_OP); > > + if (!attr) > > + return -ENOBUFS; > > + > > + for (i =3D 0; i < rqstp->opcnt; i++) { > > + struct nlattr *op_attr; > > + > > + op_attr =3D nla_nest_start(skb, i); > > + if (!op_attr) > > + return -ENOBUFS; > > + > > + if (nla_put_u32(skb, NFSD_ATTR_RPC_STATUS_COMP_OP, > > + rqstp->opnum[i])) > > + return -ENOBUFS; > > + > > + nla_nest_end(skb, op_attr); > > + } > > + > > + nla_nest_end(skb, attr); > > + } > > + > > + genlmsg_end(skb, hdr); > > + > > return 0; > > } > > =20 > > int nfsd_server_nl_rpc_status_get_dumpit(struct sk_buff *skb, > > struct netlink_callback *cb) > > { > > + struct nfsd_net *nn =3D net_generic(sock_net(skb->sk), nfsd_net_id); > > + int i, ret, rqstp_index; > > + > > + rcu_read_lock(); > > + > > + for (i =3D 0; i < nn->nfsd_serv->sv_nrpools; i++) { > > + struct svc_rqst *rqstp; > > + > > + if (i < cb->args[0]) /* already consumed */ > > + continue; > > + > > + rqstp_index =3D 0; > > + list_for_each_entry_rcu(rqstp, > > + &nn->nfsd_serv->sv_pools[i].sp_all_threads, > > + rq_all) { > > + struct nfsd_genl_rqstp genl_rqstp; > > + unsigned int status_counter; > > + > > + if (rqstp_index++ < cb->args[1]) /* already consumed */ > > + continue; > > + /* > > + * Acquire rq_status_counter before parsing the rqst > > + * fields. rq_status_counter is set to an odd value in > > + * order to notify the consumers the rqstp fields are > > + * meaningful. > > + */ > > + status_counter =3D > > + smp_load_acquire(&rqstp->rq_status_counter); > > + if (!(status_counter & 1)) > > + continue; > > + > > + genl_rqstp.rq_xid =3D rqstp->rq_xid; > > + genl_rqstp.rq_flags =3D rqstp->rq_flags; > > + genl_rqstp.rq_vers =3D rqstp->rq_vers; > > + genl_rqstp.rq_prog =3D rqstp->rq_prog; > > + genl_rqstp.rq_proc =3D rqstp->rq_proc; > > + genl_rqstp.rq_stime =3D rqstp->rq_stime; > > + genl_rqstp.opcnt =3D 0; > > + memcpy(&genl_rqstp.daddr, svc_daddr(rqstp), > > + sizeof(struct sockaddr)); > > + memcpy(&genl_rqstp.saddr, svc_addr(rqstp), > > + sizeof(struct sockaddr)); > > + > > +#ifdef CONFIG_NFSD_V4 > > + if (rqstp->rq_vers =3D=3D NFS4_VERSION && > > + rqstp->rq_proc =3D=3D NFSPROC4_COMPOUND) { > > + /* NFSv4 compund */ > > + struct nfsd4_compoundargs *args; > > + int j; > > + > > + args =3D rqstp->rq_argp; > > + genl_rqstp.opcnt =3D args->opcnt; > > + for (j =3D 0; j < genl_rqstp.opcnt; j++) > > + genl_rqstp.opnum[j] =3D > > + args->ops[j].opnum; > > + } > > +#endif /* CONFIG_NFSD_V4 */ > > + > > + /* > > + * Acquire rq_status_counter before reporting the rqst > > + * fields to the user. > > + */ > > + if (smp_load_acquire(&rqstp->rq_status_counter) !=3D > > + status_counter) > > + continue; > > + > > + ret =3D nfsd_genl_rpc_status_compose_msg(skb, cb, > > + &genl_rqstp); > > + if (ret) > > + goto out; > > + } > > + } > > + > > + cb->args[0] =3D i; > > + cb->args[1] =3D rqstp_index; > > + ret =3D skb->len; > > +out: > > + rcu_read_unlock(); > > + > > + return ret; > > +} > > + > > +int nfsd_server_nl_rpc_status_get_done(struct netlink_callback *cb) > > +{ > > + mutex_lock(&nfsd_mutex); > > + nfsd_put(sock_net(cb->skb->sk)); > > + mutex_unlock(&nfsd_mutex); > > + > > return 0; > > } > > =20 >=20 > I think there is a potential race above. Once you've=20 >=20 >=20 > > @@ -1605,6 +1788,10 @@ static int __init init_nfsd(void) > > retval =3D register_filesystem(&nfsd_fs_type); > > if (retval) > > goto out_free_all; > > + retval =3D genl_register_family(&nfsd_server_nl_family); > > + if (retval) > > + goto out_free_all; > > + > > return 0; > > out_free_all: > > nfsd4_destroy_laundry_wq(); > > @@ -1629,6 +1816,7 @@ static int __init init_nfsd(void) > > =20 > > static void __exit exit_nfsd(void) > > { > > + genl_unregister_family(&nfsd_server_nl_family); > > unregister_filesystem(&nfsd_fs_type); > > nfsd4_destroy_laundry_wq(); > > unregister_cld_notifier(); > > diff --git a/fs/nfsd/nfsd.h b/fs/nfsd/nfsd.h > > index 11c14faa6c67..d787bd38c053 100644 > > --- a/fs/nfsd/nfsd.h > > +++ b/fs/nfsd/nfsd.h > > @@ -62,6 +62,22 @@ struct readdir_cd { > > __be32 err; /* 0, nfserr, or nfserr_eof */ > > }; > > =20 > > +/* Maximum number of operations per session compound */ > > +#define NFSD_MAX_OPS_PER_COMPOUND 50 > > + > > +struct nfsd_genl_rqstp { > > + struct sockaddr daddr; > > + struct sockaddr saddr; > > + unsigned long rq_flags; > > + ktime_t rq_stime; > > + __be32 rq_xid; > > + u32 rq_vers; > > + u32 rq_prog; > > + u32 rq_proc; > > + /* NFSv4 compund */ > > + u32 opnum[NFSD_MAX_OPS_PER_COMPOUND]; > > + u16 opcnt; > > +}; > > =20 > > extern struct svc_program nfsd_program; > > extern const struct svc_version nfsd_version2, nfsd_version3, nfsd_ver= sion4; > > diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c > > index 1582af33e204..fad34a7325b3 100644 > > --- a/fs/nfsd/nfssvc.c > > +++ b/fs/nfsd/nfssvc.c > > @@ -998,6 +998,15 @@ int nfsd_dispatch(struct svc_rqst *rqstp) > > if (!proc->pc_decode(rqstp, &rqstp->rq_arg_stream)) > > goto out_decode_err; > > =20 > > + /* > > + * Release rq_status_counter setting it to an odd value after the rpc > > + * request has been properly parsed. rq_status_counter is used to > > + * notify the consumers if the rqstp fields are stable > > + * (rq_status_counter is odd) or not meaningful (rq_status_counter > > + * is even). > > + */ > > + smp_store_release(&rqstp->rq_status_counter, rqstp->rq_status_counter= | 1); > > + > > rp =3D NULL; > > switch (nfsd_cache_lookup(rqstp, &rp)) { > > case RC_DOIT: > > @@ -1015,6 +1024,12 @@ int nfsd_dispatch(struct svc_rqst *rqstp) > > if (!proc->pc_encode(rqstp, &rqstp->rq_res_stream)) > > goto out_encode_err; > > =20 > > + /* > > + * Release rq_status_counter setting it to an even value after the rp= c > > + * request has been properly processed. > > + */ > > + smp_store_release(&rqstp->rq_status_counter, rqstp->rq_status_counter= + 1); > > + > > nfsd_cache_update(rqstp, rp, rqstp->rq_cachetype, statp + 1); > > out_cached_reply: > > return 1; > > diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h > > index cbddcf484dba..41bdc913fa71 100644 > > --- a/fs/nfsd/state.h > > +++ b/fs/nfsd/state.h > > @@ -174,8 +174,6 @@ static inline struct nfs4_delegation *delegstateid(= struct nfs4_stid *s) > > =20 > > /* Maximum number of slots per session. 160 is useful for long haul TC= P */ > > #define NFSD_MAX_SLOTS_PER_SESSION 160 > > -/* Maximum number of operations per session compound */ > > -#define NFSD_MAX_OPS_PER_COMPOUND 50 > > /* Maximum session per slot cache size */ > > #define NFSD_SLOT_CACHE_SIZE 2048 > > /* Maximum number of NFSD_SLOT_CACHE_SIZE slots per session */ > > diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h > > index dbf5b21feafe..caa20defd255 100644 > > --- a/include/linux/sunrpc/svc.h > > +++ b/include/linux/sunrpc/svc.h > > @@ -251,6 +251,7 @@ struct svc_rqst { > > * net namespace > > */ > > void ** rq_lease_breaker; /* The v4 client breaking a lease */ > > + unsigned int rq_status_counter; /* RPC processing counter */ > > }; > > =20 > > /* bits for rq_flags */ >=20 --=20 Jeff Layton