nfsd4: Handle the NFSv4 READDIR 'dircount' hint being zero
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Thu, 30 Sep 2021 19:44:41 +0000 (15:44 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Oct 2021 08:04:24 +0000 (10:04 +0200)
commit8f174a208c4c7dae73b36db2ca84d06ee901ecb1
treecda4df69acfa5694d131253137450dcf17582603
parent12d4b179022ac7d07aa263b46159779536b3c6a6
nfsd4: Handle the NFSv4 READDIR 'dircount' hint being zero

commit f2e717d655040d632c9015f19aa4275f8b16e7f2 upstream.

RFC3530 notes that the 'dircount' field may be zero, in which case the
recommendation is to ignore it, and only enforce the 'maxcount' field.
In RFC5661, this recommendation to ignore a zero valued field becomes a
requirement.

Fixes: aee377644146 ("nfsd4: fix rd_dircount enforcement")
Cc: <stable@vger.kernel.org>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfsd/nfs4xdr.c