* [PATCH v1] ntfs: report birth time for symbolic links
@ 2026-10-14 1:18 Xuewen Wang
2026-10-14 1:35 ` liubaolin
2026-10-14 12:44 ` Namjae Jeon
0 siblings, 2 replies; 3+ messages in thread
From: Xuewen Wang @ 2026-10-14 1:18 UTC (permalink / raw)
To: linkinjeon, hyc.lee; +Cc: ntfs, linux-kernel, Xuewen Wang
NTFS already loads the creation time into i_crtime and reports it through
ntfs_getattr(). However, the symbolic-link inode operations omit getattr,
so statx() with AT_SYMLINK_NOFOLLOW falls back to generic_fillattr() and
does not return STATX_BTIME for the link itself.
Use ntfs_getattr() for symbolic links to expose their stored creation time.
Signed-off-by: Xuewen Wang <wangxuewen@kylinos.cn>
---
Tested in QEMU with WSL and native symlinks, including dangling links and
links to directories. Birth times survive inode cache eviction, remounts
and a fresh boot. Queries that follow a link still report the target's
creation time.
fs/ntfs/file.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c
index 58afd310d57b..58aad7f5c6c5 100644
--- a/fs/ntfs/file.c
+++ b/fs/ntfs/file.c
@@ -1556,6 +1556,7 @@ const struct inode_operations ntfs_file_inode_ops = {
const struct inode_operations ntfs_symlink_inode_operations = {
.get_link = ntfs_get_link,
.setattr = ntfs_setattr,
+ .getattr = ntfs_getattr,
.listxattr = ntfs_listxattr,
.fileattr_get = ntfs_fileattr_get,
.fileattr_set = ntfs_fileattr_set,
--
2.25.1
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v1] ntfs: report birth time for symbolic links
2026-10-14 1:18 [PATCH v1] ntfs: report birth time for symbolic links Xuewen Wang
@ 2026-10-14 1:35 ` liubaolin
2026-10-14 12:44 ` Namjae Jeon
1 sibling, 0 replies; 3+ messages in thread
From: liubaolin @ 2026-10-14 1:35 UTC (permalink / raw)
To: Xuewen Wang, linkinjeon, hyc.lee; +Cc: ntfs, linux-kernel
在 2026/10/14 09:18, Xuewen Wang 写道:
> NTFS already loads the creation time into i_crtime and reports it through
> ntfs_getattr(). However, the symbolic-link inode operations omit getattr,
> so statx() with AT_SYMLINK_NOFOLLOW falls back to generic_fillattr() and
> does not return STATX_BTIME for the link itself.
>
> Use ntfs_getattr() for symbolic links to expose their stored creation time.
>
> Signed-off-by: Xuewen Wang <wangxuewen@kylinos.cn>
> ---
> Tested in QEMU with WSL and native symlinks, including dangling links and
> links to directories. Birth times survive inode cache eviction, remounts
> and a fresh boot. Queries that follow a link still report the target's
> creation time.
>
> fs/ntfs/file.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c
> index 58afd310d57b..58aad7f5c6c5 100644
> --- a/fs/ntfs/file.c
> +++ b/fs/ntfs/file.c
> @@ -1556,6 +1556,7 @@ const struct inode_operations ntfs_file_inode_ops = {
> const struct inode_operations ntfs_symlink_inode_operations = {
> .get_link = ntfs_get_link,
> .setattr = ntfs_setattr,
> + .getattr = ntfs_getattr,
> .listxattr = ntfs_listxattr,
> .fileattr_get = ntfs_fileattr_get,
> .fileattr_set = ntfs_fileattr_set,
Looks good to me.
Reviewed-by: Baolin Liu <liubaolin@kylinos.cn>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v1] ntfs: report birth time for symbolic links
2026-10-14 1:18 [PATCH v1] ntfs: report birth time for symbolic links Xuewen Wang
2026-10-14 1:35 ` liubaolin
@ 2026-10-14 12:44 ` Namjae Jeon
1 sibling, 0 replies; 3+ messages in thread
From: Namjae Jeon @ 2026-10-14 12:44 UTC (permalink / raw)
To: Xuewen Wang; +Cc: hyc.lee, ntfs, linux-kernel
On Wed, Oct 14, 2026 at 10:18 AM Xuewen Wang <wangxuewen@kylinos.cn> wrote:
>
> NTFS already loads the creation time into i_crtime and reports it through
> ntfs_getattr(). However, the symbolic-link inode operations omit getattr,
> so statx() with AT_SYMLINK_NOFOLLOW falls back to generic_fillattr() and
> does not return STATX_BTIME for the link itself.
>
> Use ntfs_getattr() for symbolic links to expose their stored creation time.
>
> Signed-off-by: Xuewen Wang <wangxuewen@kylinos.cn>
Applied it to #ntfs-next.
Thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-14 12:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-14 1:18 [PATCH v1] ntfs: report birth time for symbolic links Xuewen Wang
2026-10-14 1:35 ` liubaolin
2026-10-14 12:44 ` Namjae Jeon
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®