]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
smb/server: fix return value of smb2_read()
authorChenXiaoSong <chenxiaosong@kylinos.cn>
Fri, 17 Oct 2025 10:46:07 +0000 (18:46 +0800)
committerSteve French <stfrench@microsoft.com>
Mon, 1 Dec 2025 03:11:43 +0000 (21:11 -0600)
STATUS_END_OF_FILE maps to the linux error -ENODATA. Perhaps in the future
we can move client/smb2maperror.c into common/ and then call
map_smb2_to_linux_error() to get the linux error.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/server/smb2pdu.c

index 17ce41fb99957568ae3f92feba4912ebd3afd9f7..6a482e4c1d623af01320b6cdcf28f770de65af66 100644 (file)
@@ -6832,7 +6832,7 @@ int smb2_read(struct ksmbd_work *work)
                rsp->hdr.Status = STATUS_END_OF_FILE;
                smb2_set_err_rsp(work);
                ksmbd_fd_put(work, fp);
-               return 0;
+               return -ENODATA;
        }
 
        ksmbd_debug(SMB, "nbytes %zu, offset %lld mincount %zu\n",