From: ChenXiaoSong <chenxiaosong@chenxiaosong.com>
To: linkinjeon@kernel.org, tom@talpey.com, senozhatsky@chromium.org,
chenxiaosong@chenxiaosong.com
Cc: linux-cifs@vger.kernel.org, ChenXiaoSong <chenxiaosong@kylinos.cn>
Subject: [PATCH v5 1/3] smb/server: support compound fid in notify requests
Date: Tue, 25 Aug 2026 13:51:06 +0000 [thread overview]
Message-ID: <20260825135108.716663-2-chenxiaosong@chenxiaosong.com> (raw)
In-Reply-To: <20260825135108.716663-1-chenxiaosong@chenxiaosong.com>
From: ChenXiaoSong <chenxiaosong@kylinos.cn>
A Windows client can send a compound request containing:
Create Request, File: <share>; Notify Request
The Notify Request uses FFFF...FFFF as the compound FID.
Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
fs/smb/server/smb2pdu.c | 41 -----------------------------------------
1 file changed, 41 deletions(-)
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index 2fbd9010513e..86f93f81cdfd 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -11818,47 +11818,6 @@ int smb2_notify(struct ksmbd_work *work)
return -EIO;
}
- /*
- * macOS backupd sends CHANGE_NOTIFY with FileId=FFFF...FFFF (share-root
- * sentinel) to watch for changes on the share root without holding an
- * open handle. Respond STATUS_PENDING + STATUS_NOTIFY_CLEANUP immediately;
- * without this, backupd aborts Time Machine setup on STATUS_FILE_CLOSED.
- */
- if (req->VolatileFileId == SMB2_NO_FID &&
- req->PersistentFileId == SMB2_NO_FID) {
- in_work = ksmbd_alloc_work_struct();
- if (!in_work || allocate_interim_rsp_buf(in_work)) {
- if (in_work)
- ksmbd_free_work_struct(in_work);
- rsp->hdr.Status = STATUS_INSUFFICIENT_RESOURCES;
- smb2_set_err_rsp(work);
- return 0;
- }
- if (setup_async_work(work, NULL, NULL)) {
- ksmbd_free_work_struct(in_work);
- rsp->hdr.Status = STATUS_INSUFFICIENT_RESOURCES;
- smb2_set_err_rsp(work);
- return 0;
- }
- smb2_send_interim_resp(work, STATUS_PENDING);
- in_work->conn = work->conn;
- in_hdr = smb_get_msg(in_work->response_buf);
- memcpy(in_hdr, ksmbd_resp_buf_next(work),
- __SMB2_HEADER_STRUCTURE_SIZE);
- in_hdr->Flags |= SMB2_FLAGS_ASYNC_COMMAND;
- in_hdr->Id.AsyncId = cpu_to_le64(work->async_id);
- smb2_set_err_rsp(in_work);
- in_hdr->Status = STATUS_NOTIFY_CLEANUP;
- in_work->async_id = work->async_id;
- work->async_id = 0;
- release_async_work(work);
- if (smb2_send_interim_work(in_work, work, false))
- ksmbd_debug(SMB, "failed to send notify cleanup\n");
- ksmbd_free_work_struct(in_work);
- work->send_no_response = 1;
- return 0;
- }
-
/*
* KSMBD does not implement a real change-notification backend.
* Genuine SMB2 servers (and macOS smbfs) never complete a
--
2.55.0
next prev parent reply other threads:[~2026-08-25 13:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-25 13:51 [PATCH v5 0/3] ksmbd: refactor smb2_notify() to a blocking wait ChenXiaoSong
2026-08-25 13:51 ` ChenXiaoSong [this message]
2026-08-25 13:51 ` [PATCH v5 2/3] ksmbd: temporarily remove interim-work change notify handling ChenXiaoSong
2026-08-25 13:51 ` [PATCH v5 3/3] ksmbd: refactor smb2_notify() to a blocking wait ChenXiaoSong
2026-08-28 16:16 ` [PATCH v5 0/3] " Namjae Jeon
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=20260825135108.716663-2-chenxiaosong@chenxiaosong.com \
--to=chenxiaosong@chenxiaosong.com \
--cc=chenxiaosong@kylinos.cn \
--cc=linkinjeon@kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=senozhatsky@chromium.org \
--cc=tom@talpey.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