Skip to content

Commit d1a30b9

Browse files
ChenXiaoSongsmfrench
authored andcommitted
smb/server: fix return value of smb2_notify()
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> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent c5b462e commit d1a30b9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

fs/smb/server/smb2pdu.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8777,7 +8777,7 @@ int smb2_oplock_break(struct ksmbd_work *work)
87778777
* smb2_notify() - handler for smb2 notify request
87788778
* @work: smb work containing notify command buffer
87798779
*
8780-
* Return: 0
8780+
* Return: 0 on success, otherwise error
87818781
*/
87828782
int smb2_notify(struct ksmbd_work *work)
87838783
{
@@ -8791,12 +8791,12 @@ int smb2_notify(struct ksmbd_work *work)
87918791
if (work->next_smb2_rcv_hdr_off && req->hdr.NextCommand) {
87928792
rsp->hdr.Status = STATUS_INTERNAL_ERROR;
87938793
smb2_set_err_rsp(work);
8794-
return 0;
8794+
return -EIO;
87958795
}
87968796

87978797
smb2_set_err_rsp(work);
87988798
rsp->hdr.Status = STATUS_NOT_IMPLEMENTED;
8799-
return 0;
8799+
return -EOPNOTSUPP;
88008800
}
88018801

88028802
/**

0 commit comments

Comments
 (0)