]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.14/fix-incorrect-error-code-mapping-for-objectid_not_fo.patch
Linux 4.9.170
[thirdparty/kernel/stable-queue.git] / queue-4.14 / fix-incorrect-error-code-mapping-for-objectid_not_fo.patch
1 From ab8ebbb5c60494b403931598eb71cd9feaed54a6 Mon Sep 17 00:00:00 2001
2 From: Steve French <stfrench@microsoft.com>
3 Date: Sun, 17 Mar 2019 15:58:38 -0500
4 Subject: fix incorrect error code mapping for OBJECTID_NOT_FOUND
5
6 [ Upstream commit 85f9987b236cf46e06ffdb5c225cf1f3c0acb789 ]
7
8 It was mapped to EIO which can be confusing when user space
9 queries for an object GUID for an object for which the server
10 file system doesn't support (or hasn't saved one).
11
12 As Amir Goldstein suggested this is similar to ENOATTR
13 (equivalently ENODATA in Linux errno definitions) so
14 changing NT STATUS code mapping for OBJECTID_NOT_FOUND
15 to ENODATA.
16
17 Signed-off-by: Steve French <stfrench@microsoft.com>
18 CC: Amir Goldstein <amir73il@gmail.com>
19 Signed-off-by: Sasha Levin <sashal@kernel.org>
20 ---
21 fs/cifs/smb2maperror.c | 3 ++-
22 1 file changed, 2 insertions(+), 1 deletion(-)
23
24 diff --git a/fs/cifs/smb2maperror.c b/fs/cifs/smb2maperror.c
25 index d7e839cb773f..92c9cdf4704d 100644
26 --- a/fs/cifs/smb2maperror.c
27 +++ b/fs/cifs/smb2maperror.c
28 @@ -1035,7 +1035,8 @@ static const struct status_to_posix_error smb2_error_map_table[] = {
29 {STATUS_UNFINISHED_CONTEXT_DELETED, -EIO,
30 "STATUS_UNFINISHED_CONTEXT_DELETED"},
31 {STATUS_NO_TGT_REPLY, -EIO, "STATUS_NO_TGT_REPLY"},
32 - {STATUS_OBJECTID_NOT_FOUND, -EIO, "STATUS_OBJECTID_NOT_FOUND"},
33 + /* Note that ENOATTTR and ENODATA are the same errno */
34 + {STATUS_OBJECTID_NOT_FOUND, -ENODATA, "STATUS_OBJECTID_NOT_FOUND"},
35 {STATUS_NO_IP_ADDRESSES, -EIO, "STATUS_NO_IP_ADDRESSES"},
36 {STATUS_WRONG_CREDENTIAL_HANDLE, -EIO,
37 "STATUS_WRONG_CREDENTIAL_HANDLE"},
38 --
39 2.19.1
40