[PATCH 1/8] smb/server: fix return value of smb2_open()

chenxiaosong@chenxiaosong.com posted 8 patches 1 year, 5 months ago
There is a newer version of this series
[PATCH 1/8] smb/server: fix return value of smb2_open()
Posted by chenxiaosong@chenxiaosong.com 1 year, 5 months ago
From: ChenXiaoSong <chenxiaosong@kylinos.cn>

In most error cases, error code is not returned in smb2_open(),
__process_request() will not print error message.

Fix this by returning the correct value at the end of smb2_open().

Signed-off-by: ChenXiaoSong <chenxiaosong@chenxiaosong.com>
---
 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 2df1354288e6..d8a827e0dced 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -3710,7 +3710,7 @@ int smb2_open(struct ksmbd_work *work)
 	kfree(name);
 	kfree(lc);
 
-	return 0;
+	return rc;
 }
 
 static int readdir_info_level_struct_sz(int info_level)
-- 
2.34.1
Re: [PATCH 1/8] smb/server: fix return value of smb2_open()
Posted by Namjae Jeon 1 year, 5 months ago
On Tue, Aug 20, 2024 at 11:35 PM <chenxiaosong@chenxiaosong.com> wrote:
>
> From: ChenXiaoSong <chenxiaosong@kylinos.cn>
>
> In most error cases, error code is not returned in smb2_open(),
> __process_request() will not print error message.
>
> Fix this by returning the correct value at the end of smb2_open().
>
> Signed-off-by: ChenXiaoSong <chenxiaosong@chenxiaosong.com>
Looks good to me.
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Thanks!