ksmbd: return STATUS_OBJECT_NAME_NOT_FOUND for unknown IPC pipe names

create_smb2_pipe() maps ksmbd_session_rpc_open() failing with -EINVAL
(pipe name not recognized/supported) to STATUS_INVALID_PARAMETER.
macOS Time Machine's backupd treats STATUS_INVALID_PARAMETER on a
pipe open as a fatal error and aborts the backup immediately, whereas
STATUS_OBJECT_NAME_NOT_FOUND is handled gracefully -- the client just
treats that particular pipe as unavailable and continues.

Assisted-by: Claude:claude-sonnet-5
Signed-off-by: Gael Blivet <gael.blivet@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
This commit is contained in:
Gael Blivet 2026-07-07 11:55:04 +02:00 committed by Namjae Jeon
parent a9417bb188
commit 9870bbb55a

View File

@ -2640,7 +2640,13 @@ static noinline int create_smb2_pipe(struct ksmbd_work *work)
out:
switch (err) {
case -EINVAL:
rsp->hdr.Status = STATUS_INVALID_PARAMETER;
/*
* Unknown pipe name: return STATUS_OBJECT_NAME_NOT_FOUND so
* macOS clients skip it gracefully. STATUS_INVALID_PARAMETER
* causes macOS Time Machine to abort the backup immediately
* (confirmed in ksmbd issue #502 / namjaejeon/ksmbd).
*/
rsp->hdr.Status = STATUS_OBJECT_NAME_NOT_FOUND;
break;
case -ENOSPC:
case -ENOMEM: