Re: [PATCH] ksmbd: set create_time to btime in ksmbd_vfs_fill_dentry_attrs()
From: Namjae Jeon
Date: Tue Nov 10 2026 - 17:45:53 EST
On Wed, Nov 11, 2026 at 4:56 AM Ian Bridges <icb@xxxxxxxxxxxx> wrote:
>
> Hi,
>
> On Tue, Nov 10, 2026 at 05:16:59PM +0100, koraynilay wrote:
> > ksmbd_vfs_fill_dentry_attrs() queries vfs_getattr() with STATX_BTIME,
> > but discards ksmbd_kstat->kstat->btime and unconditionally initializes
> > ksmbd_kstat->create_time to ksmbd_kstat->kstat->ctime.
>
> I tested this on a kernel whose fs/smb/server matches ksmbd-for-next,
> with files and a directory created on the server, so without the DOS
> attribute xattr. Before the patch, a directory listing reported their
> ctime as the creation time, while a query on the open file reported
> the btime. With the patch, both report the btime. A file created over
> SMB keeps its stored creation time in both. smbtorture gives the same
> results as without the patch, and KASAN reports nothing.
>
> Reviewed-by: Ian Bridges <icb@xxxxxxxxxxxx>
> Tested-by: Ian Bridges <icb@xxxxxxxxxxxx>
Applied this patch to #ksmbd-for-next.
Thanks!