Linux CIFS filesystem development
 help / color / mirror / Atom feed
* [PATCH] smb/server: call ksmbd_session_rpc_close() on error path in create_smb2_pipe()
@ 2025-12-28 14:51 chenxiaosong.chenxiaosong
  2025-12-29  2:58 ` Namjae Jeon
  0 siblings, 1 reply; 2+ messages in thread
From: chenxiaosong.chenxiaosong @ 2025-12-28 14:51 UTC (permalink / raw)
  To: smfrench, linkinjeon, pc, ronniesahlberg, sprasad, tom, bharathsm,
	senozhatsky, dhowells
  Cc: linux-cifs, ZhangGuoDong, ChenXiaoSong

From: ZhangGuoDong <zhangguodong@kylinos.cn>

When ksmbd_iov_pin_rsp() fails, we should call ksmbd_session_rpc_close().

Signed-off-by: ZhangGuoDong <zhangguodong@kylinos.cn>
Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
 fs/smb/server/smb2pdu.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index 469b70757dba..571e9d5657c1 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -2281,7 +2281,7 @@ static noinline int create_smb2_pipe(struct ksmbd_work *work)
 {
 	struct smb2_create_rsp *rsp;
 	struct smb2_create_req *req;
-	int id;
+	int id = -1;
 	int err;
 	char *name;
 
@@ -2338,6 +2338,9 @@ static noinline int create_smb2_pipe(struct ksmbd_work *work)
 		break;
 	}
 
+	if (id >= 0)
+		ksmbd_session_rpc_close(work->sess, id);
+
 	if (!IS_ERR(name))
 		kfree(name);
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] smb/server: call ksmbd_session_rpc_close() on error path in create_smb2_pipe()
  2025-12-28 14:51 [PATCH] smb/server: call ksmbd_session_rpc_close() on error path in create_smb2_pipe() chenxiaosong.chenxiaosong
@ 2025-12-29  2:58 ` Namjae Jeon
  0 siblings, 0 replies; 2+ messages in thread
From: Namjae Jeon @ 2025-12-29  2:58 UTC (permalink / raw)
  To: chenxiaosong.chenxiaosong
  Cc: smfrench, pc, ronniesahlberg, sprasad, tom, bharathsm,
	senozhatsky, dhowells, linux-cifs, ZhangGuoDong, ChenXiaoSong

On Sun, Dec 28, 2025 at 11:52 PM <chenxiaosong.chenxiaosong@linux.dev> wrote:
>
> From: ZhangGuoDong <zhangguodong@kylinos.cn>
>
> When ksmbd_iov_pin_rsp() fails, we should call ksmbd_session_rpc_close().
>
> Signed-off-by: ZhangGuoDong <zhangguodong@kylinos.cn>
> Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Applied it to #ksmbd-for-next-next.
Thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-12-29  2:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-28 14:51 [PATCH] smb/server: call ksmbd_session_rpc_close() on error path in create_smb2_pipe() chenxiaosong.chenxiaosong
2025-12-29  2:58 ` Namjae Jeon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox