Skip to content

Commit 269df04

Browse files
ChenXiaoSongsmfrench
authored andcommitted
smb/server: fix return value of smb2_ioctl()
__process_request() will not print error messages if smb2_ioctl() always returns 0. Fix this by returning the correct value at the end of function. Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent dafe22b commit 269df04

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

fs/smb/server/smb2pdu.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8154,7 +8154,7 @@ int smb2_ioctl(struct ksmbd_work *work)
81548154
id = req->VolatileFileId;
81558155

81568156
if (req->Flags != cpu_to_le32(SMB2_0_IOCTL_IS_FSCTL)) {
8157-
rsp->hdr.Status = STATUS_NOT_SUPPORTED;
8157+
ret = -EOPNOTSUPP;
81588158
goto out;
81598159
}
81608160

@@ -8174,8 +8174,9 @@ int smb2_ioctl(struct ksmbd_work *work)
81748174
case FSCTL_DFS_GET_REFERRALS:
81758175
case FSCTL_DFS_GET_REFERRALS_EX:
81768176
/* Not support DFS yet */
8177+
ret = -EOPNOTSUPP;
81778178
rsp->hdr.Status = STATUS_FS_DRIVER_REQUIRED;
8178-
goto out;
8179+
goto out2;
81798180
case FSCTL_CREATE_OR_GET_OBJECT_ID:
81808181
{
81818182
struct file_object_buf_type1_ioctl_rsp *obj_buf;
@@ -8465,8 +8466,10 @@ int smb2_ioctl(struct ksmbd_work *work)
84658466
rsp->hdr.Status = STATUS_BUFFER_TOO_SMALL;
84668467
else if (ret < 0 || rsp->hdr.Status == 0)
84678468
rsp->hdr.Status = STATUS_INVALID_PARAMETER;
8469+
8470+
out2:
84688471
smb2_set_err_rsp(work);
8469-
return 0;
8472+
return ret;
84708473
}
84718474

84728475
/**

0 commit comments

Comments
 (0)