Skip to content

Commit a2d6142

Browse files
committed
NFSD: Make nfsd_genl_rqstp::rq_ops array best-effort
To enable NFSD to handle NFSv4 COMPOUNDs of unrestricted size, resize the array in struct nfsd_genl_rqstp so it saves only up to 16 operations per COMPOUND. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent 71bc2c6 commit a2d6142

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

fs/nfsd/nfsctl.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1569,7 +1569,8 @@ int nfsd_nl_rpc_status_get_dumpit(struct sk_buff *skb,
15691569
int j;
15701570

15711571
args = rqstp->rq_argp;
1572-
genl_rqstp.rq_opcnt = args->opcnt;
1572+
genl_rqstp.rq_opcnt = min_t(u32, args->opcnt,
1573+
ARRAY_SIZE(genl_rqstp.rq_opnum));
15731574
for (j = 0; j < genl_rqstp.rq_opcnt; j++)
15741575
genl_rqstp.rq_opnum[j] =
15751576
args->ops[j].opnum;

fs/nfsd/nfsd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ struct nfsd_genl_rqstp {
7272

7373
/* NFSv4 compound */
7474
u32 rq_opcnt;
75-
u32 rq_opnum[NFSD_MAX_OPS_PER_COMPOUND];
75+
u32 rq_opnum[16];
7676
};
7777

7878
extern struct svc_program nfsd_programs[];

0 commit comments

Comments
 (0)