Skip to content

Commit f764fab

Browse files
paliSteve French
authored andcommitted
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: Pali Rohár <pali@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent e0b1f59 commit f764fab

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

fs/smb/client/netmisc.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,13 @@ map_smb_to_linux_error(char *buf, bool logErr)
871871
}
872872
/* else ERRHRD class errors or junk - return EIO */
873873

874+
/* special cases for NT status codes which cannot be translated to DOS codes */
875+
if (smb->Flags2 & SMBFLG2_ERR_STATUS) {
876+
__u32 err = le32_to_cpu(smb->Status.CifsError);
877+
if (err == (NT_STATUS_NOT_A_REPARSE_POINT))
878+
rc = -ENODATA;
879+
}
880+
874881
cifs_dbg(FYI, "Mapping smb error code 0x%x to POSIX err %d\n",
875882
le32_to_cpu(smb->Status.CifsError), rc);
876883

fs/smb/client/nterr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,7 @@ const struct nt_err_code_struct nt_errs[] = {
674674
{"NT_STATUS_QUOTA_LIST_INCONSISTENT",
675675
NT_STATUS_QUOTA_LIST_INCONSISTENT},
676676
{"NT_STATUS_FILE_IS_OFFLINE", NT_STATUS_FILE_IS_OFFLINE},
677+
{"NT_STATUS_NOT_A_REPARSE_POINT", NT_STATUS_NOT_A_REPARSE_POINT},
677678
{"NT_STATUS_NO_MORE_ENTRIES", NT_STATUS_NO_MORE_ENTRIES},
678679
{"NT_STATUS_MORE_ENTRIES", NT_STATUS_MORE_ENTRIES},
679680
{"NT_STATUS_SOME_UNMAPPED", NT_STATUS_SOME_UNMAPPED},

fs/smb/client/nterr.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,7 @@ extern const struct nt_err_code_struct nt_errs[];
546546
#define NT_STATUS_TOO_MANY_LINKS 0xC0000000 | 0x0265
547547
#define NT_STATUS_QUOTA_LIST_INCONSISTENT 0xC0000000 | 0x0266
548548
#define NT_STATUS_FILE_IS_OFFLINE 0xC0000000 | 0x0267
549+
#define NT_STATUS_NOT_A_REPARSE_POINT 0xC0000000 | 0x0275
549550
#define NT_STATUS_NO_SUCH_JOB 0xC0000000 | 0xEDE /* scheduler */
550551

551552
#endif /* _NTERR_H */

fs/smb/client/smb2maperror.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ static const struct status_to_posix_error smb2_error_map_table[] = {
871871
{STATUS_VALIDATE_CONTINUE, -EIO, "STATUS_VALIDATE_CONTINUE"},
872872
{STATUS_NO_MATCH, -EIO, "STATUS_NO_MATCH"},
873873
{STATUS_NO_MORE_MATCHES, -EIO, "STATUS_NO_MORE_MATCHES"},
874-
{STATUS_NOT_A_REPARSE_POINT, -EIO, "STATUS_NOT_A_REPARSE_POINT"},
874+
{STATUS_NOT_A_REPARSE_POINT, -ENODATA, "STATUS_NOT_A_REPARSE_POINT"},
875875
{STATUS_IO_REPARSE_TAG_INVALID, -EIO, "STATUS_IO_REPARSE_TAG_INVALID"},
876876
{STATUS_IO_REPARSE_TAG_MISMATCH, -EIO,
877877
"STATUS_IO_REPARSE_TAG_MISMATCH"},

0 commit comments

Comments
 (0)