NFS: Return valid errors from nfs2/3_decode_dirent()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Thu, 24 Feb 2022 15:59:37 +0000 (10:59 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:23:46 +0000 (14:23 +0200)
commit18dc19571210ca5a8b505234719f6b6c61c2b2a8
treec86ba3c1a478399595acde29bd0480f827a698a7
parent8a842f88d0e2eb9988e1a35c2d52cb9d26e99d14
NFS: Return valid errors from nfs2/3_decode_dirent()

[ Upstream commit 64cfca85bacde54caa64e0ab855c48734894fa37 ]

Valid return values for decode_dirent() callback functions are:
 0: Success
 -EBADCOOKIE: End of directory
 -EAGAIN: End of xdr_stream

All errors need to map into one of those three values.

Fixes: 573c4e1ef53a ("NFS: Simplify ->decode_dirent() calling sequence")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/nfs2xdr.c
fs/nfs/nfs3xdr.c