[PATCH 3/6] smb/server: fix return value of smb2_query_dir()

chenxiaosong.chenxiaosong@linux.dev posted 6 patches 3 months, 3 weeks ago
There is a newer version of this series
[PATCH 3/6] smb/server: fix return value of smb2_query_dir()
Posted by chenxiaosong.chenxiaosong@linux.dev 3 months, 3 weeks ago
From: ChenXiaoSong <chenxiaosong@kylinos.cn>

__process_request() will not print error messages if smb2_query_dir()
always returns 0.

Fix this by returning the correct value at the end of function.

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 c040df0a2073..dabc3a49bd15 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -4560,7 +4560,7 @@ int smb2_query_dir(struct ksmbd_work *work)
 	smb2_set_err_rsp(work);
 	ksmbd_fd_put(work, dir_fp);
 	ksmbd_revert_fsids(work);
-	return 0;
+	return rc;
 }
 
 /**
-- 
2.43.0