Skip to content

Commit 6d08851

Browse files
palismfrench
authored andcommitted
cifs: Fix printing Status code into dmesg
NT Status code is 32-bit number, so for comparing two NT Status codes is needed to check all 32 bits, and not just low 24 bits. Before this change kernel printed message: "Status code returned 0x8000002d NT_STATUS_NOT_COMMITTED" It was incorrect as because NT_STATUS_NOT_COMMITTED is defined as 0xC000002d and 0x8000002d has defined name NT_STATUS_STOPPED_ON_SYMLINK. With this change kernel prints message: "Status code returned 0x8000002d NT_STATUS_STOPPED_ON_SYMLINK" Signed-off-by: Pali Rohár <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 014fdae commit 6d08851

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/smb/client/netmisc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -775,10 +775,10 @@ cifs_print_status(__u32 status_code)
775775
int idx = 0;
776776

777777
while (nt_errs[idx].nt_errstr != NULL) {
778-
if (((nt_errs[idx].nt_errcode) & 0xFFFFFF) ==
779-
(status_code & 0xFFFFFF)) {
778+
if (nt_errs[idx].nt_errcode == status_code) {
780779
pr_notice("Status code returned 0x%08x %s\n",
781780
status_code, nt_errs[idx].nt_errstr);
781+
return;
782782
}
783783
idx++;
784784
}

0 commit comments

Comments
 (0)