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>
Sun, 17 Oct 2021 08:05:38 +0000 (10:05 +0200)
commita7a996d4364ed849faf665c91f114aeaadedf1b9
tree0460ff35f31e8b1ed8b926742e54706d0e47f019
parent286f94453fb34f7bd6b696861c89f9a13f498721
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