mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: koraynilay <koray.fra@gmail.com>
To: Namjae Jeon <linkinjeon@kernel.org>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>,
	Tom Talpey <tom@talpey.com>,
	ChenXiaoSong <chenxiaosong@chenxiaosong.com>,
	Marios Makassikis <mmakassikis@freebox.fr>,
	linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org,
	koraynilay <koray.fra@gmail.com>
Subject: [PATCH] ksmbd: set create_time to btime in ksmbd_vfs_fill_dentry_attrs()
Date: Tue, 10 Nov 2026 17:16:59 +0100	[thread overview]
Message-ID: <20261110161659.481208-1-koray.fra@gmail.com> (raw)

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.

Check ksmbd_kstat->kstat->result_mask for STATX_BTIME and set
ksmbd_kstat->create_time to ksmbd_kstat->kstat->btime, only falling back
to ctime if btime isn't returned, matching the existing behavior in
smb2_open().

Fixes: 5614c8c487f6 ("ksmbd: replace generic_fillattr with vfs_getattr")
Cc: stable@vger.kernel.org
Assisted-by: Gemini:3.8-flash-high antigravity-cli-1.5.3
Signed-off-by: koraynilay <koray.fra@gmail.com>
---
Small fix I found while implementing ptime[1].
Thanks.

[1]: https://lore.kernel.org/all/20261101015551.786044-1-koray.fra@gmail.com/T/#t

 fs/smb/server/vfs.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/smb/server/vfs.c b/fs/smb/server/vfs.c
index cb3f4f5fe9cf..0c95d4668370 100644
--- a/fs/smb/server/vfs.c
+++ b/fs/smb/server/vfs.c
@@ -1914,7 +1914,10 @@ int ksmbd_vfs_fill_dentry_attrs(struct ksmbd_work *work,
 	if (rc)
 		return rc;
 
-	time = ksmbd_UnixTimeToNT(ksmbd_kstat->kstat->ctime);
+	if (ksmbd_kstat->kstat->result_mask & STATX_BTIME)
+		time = ksmbd_UnixTimeToNT(ksmbd_kstat->kstat->btime);
+	else
+		time = ksmbd_UnixTimeToNT(ksmbd_kstat->kstat->ctime);
 	ksmbd_kstat->create_time = time;
 
 	/*

base-commit: b0af9a3e6b1534d353ca6ac23caaf46127f62e4a
-- 
2.56.0


                 reply	other threads:[~2026-11-10 16:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261110161659.481208-1-koray.fra@gmail.com \
    --to=koray.fra@gmail.com \
    --cc=chenxiaosong@chenxiaosong.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmakassikis@freebox.fr \
    --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

all inboxes | Powered by JetHome®