linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: chenxiaosong.chenxiaosong@linux.dev
To: sfrench@samba.org, smfrench@gmail.com, linkinjeon@kernel.org,
	linkinjeon@samba.org
Cc: linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org,
	ChenXiaoSong <chenxiaosong@kylinos.cn>
Subject: [PATCH 2/6] smb/server: fix return value of smb2_notify()
Date: Fri, 17 Oct 2025 16:46:06 +0800	[thread overview]
Message-ID: <20251017084610.3085644-3-chenxiaosong.chenxiaosong@linux.dev> (raw)
In-Reply-To: <20251017084610.3085644-1-chenxiaosong.chenxiaosong@linux.dev>

From: ChenXiaoSong <chenxiaosong@kylinos.cn>

smb2_notify() should return error code when an error occurs,
__process_request() will print the error messages.

I may implement the SMB2 CHANGE_NOTIFY response (see MS-SMB2 2.2.36)
in the future.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
 fs/smb/server/smb2pdu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index 83d8a325b9ea..c040df0a2073 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -8787,7 +8787,7 @@ int smb2_oplock_break(struct ksmbd_work *work)
  * smb2_notify() - handler for smb2 notify request
  * @work:   smb work containing notify command buffer
  *
- * Return:      0
+ * Return:      0 on success, otherwise error
  */
 int smb2_notify(struct ksmbd_work *work)
 {
@@ -8801,12 +8801,12 @@ int smb2_notify(struct ksmbd_work *work)
 	if (work->next_smb2_rcv_hdr_off && req->hdr.NextCommand) {
 		rsp->hdr.Status = STATUS_INTERNAL_ERROR;
 		smb2_set_err_rsp(work);
-		return 0;
+		return -EIO;
 	}
 
 	smb2_set_err_rsp(work);
 	rsp->hdr.Status = STATUS_NOT_IMPLEMENTED;
-	return 0;
+	return -EOPNOTSUPP,;
 }
 
 /**
-- 
2.43.0


  parent reply	other threads:[~2025-10-17  8:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-17  8:46 [PATCH 0/6] smb/server: fix return values of smb2_0_server_cmds proc chenxiaosong.chenxiaosong
2025-10-17  8:46 ` [PATCH 1/6] smb/server: fix return value of smb2_read() chenxiaosong.chenxiaosong
2025-10-17  8:46 ` chenxiaosong.chenxiaosong [this message]
2025-10-31 23:56   ` [PATCH 2/6] smb/server: fix return value of smb2_notify() Namjae Jeon
2025-11-01  0:05     ` ChenXiaoSong
2025-11-01  0:10       ` Namjae Jeon
2025-11-01  0:18         ` ChenXiaoSong
2025-10-17  8:46 ` [PATCH 3/6] smb/server: fix return value of smb2_query_dir() chenxiaosong.chenxiaosong
2025-10-17  8:46 ` [PATCH 4/6] smb/server: fix return value of smb2_ioctl() chenxiaosong.chenxiaosong
2025-10-17  8:46 ` [PATCH 5/6] smb/server: fix return value of smb2_oplock_break() chenxiaosong.chenxiaosong
2025-10-17  8:46 ` [PATCH 6/6] smb/server: update some misguided comment of smb2_0_server_cmds proc chenxiaosong.chenxiaosong
2025-10-17 14:02 ` [PATCH 0/6] smb/server: fix return values " Namjae Jeon
2025-10-17 14:47   ` ChenXiaoSong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251017084610.3085644-3-chenxiaosong.chenxiaosong@linux.dev \
    --to=chenxiaosong.chenxiaosong@linux.dev \
    --cc=chenxiaosong@kylinos.cn \
    --cc=linkinjeon@kernel.org \
    --cc=linkinjeon@samba.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sfrench@samba.org \
    --cc=smfrench@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).