[PATCH 4.4 117/168] fix incorrect error code mapping for OBJECTID_NOT_FOUND

From: Greg Kroah-Hartman
Date: Wed Apr 24 2019 - 13:21:05 EST

[ Upstream commit 85f9987b236cf46e06ffdb5c225cf1f3c0acb789 ]

It was mapped to EIO which can be confusing when user space
queries for an object GUID for an object for which the server
file system doesn't support (or hasn't saved one).

As Amir Goldstein suggested this is similar to ENOATTR
(equivalently ENODATA in Linux errno definitions) so
changing NT STATUS code mapping for OBJECTID_NOT_FOUND

Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx>
CC: Amir Goldstein <amir73il@xxxxxxxxx>
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
fs/cifs/smb2maperror.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/cifs/smb2maperror.c b/fs/cifs/smb2maperror.c
index 98c25b969ab8..7e93d5706bf6 100644
--- a/fs/cifs/smb2maperror.c
+++ b/fs/cifs/smb2maperror.c
@@ -1034,7 +1034,8 @@ static const struct status_to_posix_error smb2_error_map_table[] = {
+ /* Note that ENOATTTR and ENODATA are the same errno */