Commit f764fab7 authored by Pali Rohár's avatar Pali Rohár Committed by Steve French
Browse files

cifs: Change translation of STATUS_NOT_A_REPARSE_POINT to -ENODATA



STATUS_NOT_A_REPARSE_POINT indicates that object does not have reparse point
buffer attached, for example returned by FSCTL_GET_REPARSE_POINT.

Currently STATUS_NOT_A_REPARSE_POINT is translated to -EIO. Change it to
-ENODATA which better describe the situation when no reparse point is set.

Signed-off-by: default avatarPali Rohár <pali@kernel.org>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent e0b1f591
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -871,6 +871,13 @@ map_smb_to_linux_error(char *buf, bool logErr)
	}
	/* else ERRHRD class errors or junk  - return EIO */

	/* special cases for NT status codes which cannot be translated to DOS codes */
	if (smb->Flags2 & SMBFLG2_ERR_STATUS) {
		__u32 err = le32_to_cpu(smb->Status.CifsError);
		if (err == (NT_STATUS_NOT_A_REPARSE_POINT))
			rc = -ENODATA;
	}

	cifs_dbg(FYI, "Mapping smb error code 0x%x to POSIX err %d\n",
		 le32_to_cpu(smb->Status.CifsError), rc);

+1 −0
Original line number Diff line number Diff line
@@ -674,6 +674,7 @@ const struct nt_err_code_struct nt_errs[] = {
	{"NT_STATUS_QUOTA_LIST_INCONSISTENT",
	 NT_STATUS_QUOTA_LIST_INCONSISTENT},
	{"NT_STATUS_FILE_IS_OFFLINE", NT_STATUS_FILE_IS_OFFLINE},
	{"NT_STATUS_NOT_A_REPARSE_POINT", NT_STATUS_NOT_A_REPARSE_POINT},
	{"NT_STATUS_NO_MORE_ENTRIES", NT_STATUS_NO_MORE_ENTRIES},
	{"NT_STATUS_MORE_ENTRIES", NT_STATUS_MORE_ENTRIES},
	{"NT_STATUS_SOME_UNMAPPED", NT_STATUS_SOME_UNMAPPED},
+1 −0
Original line number Diff line number Diff line
@@ -546,6 +546,7 @@ extern const struct nt_err_code_struct nt_errs[];
#define NT_STATUS_TOO_MANY_LINKS 0xC0000000 | 0x0265
#define NT_STATUS_QUOTA_LIST_INCONSISTENT 0xC0000000 | 0x0266
#define NT_STATUS_FILE_IS_OFFLINE 0xC0000000 | 0x0267
#define NT_STATUS_NOT_A_REPARSE_POINT 0xC0000000 | 0x0275
#define NT_STATUS_NO_SUCH_JOB 0xC0000000 | 0xEDE	/* scheduler */

#endif				/* _NTERR_H */
+1 −1
Original line number Diff line number Diff line
@@ -871,7 +871,7 @@ static const struct status_to_posix_error smb2_error_map_table[] = {
	{STATUS_VALIDATE_CONTINUE, -EIO, "STATUS_VALIDATE_CONTINUE"},
	{STATUS_NO_MATCH, -EIO, "STATUS_NO_MATCH"},
	{STATUS_NO_MORE_MATCHES, -EIO, "STATUS_NO_MORE_MATCHES"},
	{STATUS_NOT_A_REPARSE_POINT, -EIO, "STATUS_NOT_A_REPARSE_POINT"},
	{STATUS_NOT_A_REPARSE_POINT, -ENODATA, "STATUS_NOT_A_REPARSE_POINT"},
	{STATUS_IO_REPARSE_TAG_INVALID, -EIO, "STATUS_IO_REPARSE_TAG_INVALID"},
	{STATUS_IO_REPARSE_TAG_MISMATCH, -EIO,
	"STATUS_IO_REPARSE_TAG_MISMATCH"},