Re: [RFC PATCH 10/11] smb/server: send notify events to the client
Namjae Jeon <[email protected]> Sat, 25 Jul 2026 23:02:13 +0900
| Newsgroups | org.kernel.vger.linux-cifs |
|---|---|
| Message-ID | <CAKYAXd-CNK07Z84fQD-mtdS=JAvKpyoWAJrrYNYPKWWSpcnHJA@mail.gmail.com> |
> +static int ksmbd_notify_reply(struct ksmbd_work *work,
> + struct ksmbd_notify *notify,
> + struct smb2_change_notify_req *req,
> + struct smb2_change_notify_rsp *rsp,
> + struct list_head *events)
> +{
> + u32 max_len = min(le32_to_cpu(req->OutputBufferLength),
> + notify->max_buffer_size);
Why is the response limited by notify->max_buffer_size, which is
captured when the watch is first created?
The maximum amount returned for this completion should be governed by
the current request's OutputBufferLength. Limiting it to the first
request's buffer size can unnecessarily return STATUS_NOTIFY_ENUM_DIR
even when a later request supplied a sufficiently large output buffer.
Thanks for the patch!