ksmbd: quiet mdssvc RPC log spam in create_smb2_pipe

silenced __rpc_method()'s own "Unsupported RPC: mdssvc" log line
but missed that ksmbd_session_rpc_open() failing for that same,
now-still-rejected pipe also trips a second, separate pr_err() here in
its caller. macOS's routine mdssvc (Spotlight) probes still spam the
kernel log via this second site on every single probe, defeating the
original commit's stated purpose.

Suppress this specific case the same way the other site does; behavior
is unchanged for every other RPC failure.

__rpc_method() (mgmt/user_session.c) returns -ENOENT for mdssvc, not
-EINVAL.

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-09 18:50:45 +02:00 committed by Namjae Jeon
parent 689f1eb371
commit 6cbb144f8e

View File

@ -2649,7 +2649,16 @@ static noinline int create_smb2_pipe(struct ksmbd_work *work)
id = ksmbd_session_rpc_open(work->sess, name);
if (id < 0) {
pr_err("Unable to open RPC pipe: %d\n", id);
/*
* mdssvc (Spotlight) is a routine, expected probe from macOS
* that we deliberately don't support -- it's disabled at the
* __rpc_method() level (mgmt/user_session.c), but this
* generic failure log would otherwise still fire on every
* single probe regardless.
*/
if (!(id == -ENOENT && (!strcmp(name, "\\mdssvc") ||
!strcmp(name, "mdssvc"))))
pr_err("Unable to open RPC pipe: %d\n", id);
err = id;
goto out;
}