[PATCH v2 1/6] smb/server: fix return value of smb2_read()

chenxiaosong.chenxiaosong@linux.dev posted 6 patches 3 months, 3 weeks ago
[PATCH v2 1/6] smb/server: fix return value of smb2_read()
Posted by chenxiaosong.chenxiaosong@linux.dev 3 months, 3 weeks ago
From: ChenXiaoSong <chenxiaosong@kylinos.cn>

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>
---
 fs/smb/server/smb2pdu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index f901ae18e68a..f80a3dbb2d4e 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -6842,7 +6842,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",
-- 
2.43.0
Re: [PATCH v2 1/6] smb/server: fix return value of smb2_read()
Posted by Markus Elfring 3 months, 3 weeks ago
> 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.

Will another imperative wording approach become more helpful for an improved
change description?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.18-rc1#n94


> Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>

Can a personal name deviate a bit more from an email identifier
according to the Developer's Certificate of Origin?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.18-rc1#n436

Regards,
Markus