All of lore.kernel.org
 help / color / mirror / Atom feed
* Decimated subseconds in smbinfo filebasicinfo timestamp output
       [not found]               ` <CAH2r5ms02k4feJEmfzenU-DgFMSDFDiCc1=o_JpyaiWcnOU1Tg@mail.gmail.com>
@ 2026-01-25 19:26                 ` Sam Denison
  2026-01-26  1:05                   ` ChenXiaoSong
  2026-01-27  0:11                   ` Steve French
  0 siblings, 2 replies; 3+ messages in thread
From: Sam Denison @ 2026-01-25 19:26 UTC (permalink / raw)
  To: Steve French, ChenXiaoSong, Steven French
  Cc: linux-cifs@vger.kernel.org, samba-technical@lists.samba.org

[-- Attachment #1: Type: text/plain, Size: 643 bytes --]

Okay, like this?

I’ve attached the patch kindly written by ChenXiaoSong, if I understand the intention this is simply to allow me to take credit and do little to no work! I only edited the dates and times in the patches header and examples. I haven’t ran a single Git command! Hope the patch still works.

I’ve CCed linux-cifs@vger.kernel.org and samba-technical@lists.samba.org as requested

Sam


On Tuesday, 20 January 2026 at 15:40, Steve French <smfrench@gmail.com> wrote:

> You can send your patch as an attachment to us, you shouldn't need to change your email address or worry about smtp.
> 
> Thanks,
> 
> Steve

[-- Attachment #2: 0001-smbinfo-fix-decimated-subseconds-in-smbinfo-filebasi.patch --]
[-- Type: application/octet-stream, Size: 1532 bytes --]

From 7913c1a24b03b8c3475efebbb78cac5bfb44be73 Mon Sep 17 00:00:00 2001
From: Sam Denison <dev@denisons.org>
Date: Sun, 25 Jan 2026 19:15:01 +0000
Subject: [PATCH] smbinfo: fix decimated subseconds in smbinfo filebasicinfo
 timestamp output

The output of `./smbinfo filebasicinfo /mnt/file` is as follows:

  Creation Time: 2026-01-25 19:15:01.070729
  Last Access Time: 2026-01-25 19:15:01.070729
  Last Write Time: 2026-01-25 19:15:01.070729
  Last Change Time: 2026-01-25 19:15:01.070729

The output of `stat /mnt/file` is as follows:

  Access: 2026-01-25 19:15:01.707294600 +0000
  Modify: 2026-01-25 19:15:01.707294600 +0000
  Change: 2026-01-25 19:15:01.707294600 +0000
   Birth: 2026-01-25 19:15:01.707294600 +0000

In `win_to_datetime()`, when converting `usec` to a value in seconds,
one zero needs to be removed from the divisor.

Signed-off-by: Sam Denison <dev@denisons.org>
Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
 smbinfo | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/smbinfo b/smbinfo
index 57e8a0a..a168186 100755
--- a/smbinfo
+++ b/smbinfo
@@ -428,7 +428,7 @@ def cmd_fileallinfo(args):
 def win_to_datetime(smb2_time):
     usec = (smb2_time / 10) % 1000000
     sec  = (smb2_time - 116444736000000000) // 10000000
-    return datetime.datetime.fromtimestamp(sec + usec/10000000)
+    return datetime.datetime.fromtimestamp(sec + usec/1000000)
 
 def cmd_filebasicinfo(args):
     qi = QueryInfoStruct(info_type=0x1, file_info_class=4, input_buffer_length=40)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: Decimated subseconds in smbinfo filebasicinfo timestamp output
  2026-01-25 19:26                 ` Decimated subseconds in smbinfo filebasicinfo timestamp output Sam Denison
@ 2026-01-26  1:05                   ` ChenXiaoSong
  2026-01-27  0:11                   ` Steve French
  1 sibling, 0 replies; 3+ messages in thread
From: ChenXiaoSong @ 2026-01-26  1:05 UTC (permalink / raw)
  To: Sam Denison, Steve French, Steven French
  Cc: linux-cifs@vger.kernel.org, samba-technical@lists.samba.org

Acked-by: ChenXiaoSong <chenxiaosong@kylinos.cn>

Thanks,
ChenXiaoSong <chenxiaosong@kylinos.cn>

On 1/26/26 03:26, Sam Denison wrote:
> From: Sam Denison <dev@denisons.org>
> Date: Sun, 25 Jan 2026 19:15:01 +0000
> Subject: [PATCH] smbinfo: fix decimated subseconds in smbinfo filebasicinfo
>  timestamp output
> 
> The output of `./smbinfo filebasicinfo /mnt/file` is as follows:
> 
>   Creation Time: 2026-01-25 19:15:01.070729
>   Last Access Time: 2026-01-25 19:15:01.070729
>   Last Write Time: 2026-01-25 19:15:01.070729
>   Last Change Time: 2026-01-25 19:15:01.070729
> 
> The output of `stat /mnt/file` is as follows:
> 
>   Access: 2026-01-25 19:15:01.707294600 +0000
>   Modify: 2026-01-25 19:15:01.707294600 +0000
>   Change: 2026-01-25 19:15:01.707294600 +0000
>    Birth: 2026-01-25 19:15:01.707294600 +0000
> 
> In `win_to_datetime()`, when converting `usec` to a value in seconds,
> one zero needs to be removed from the divisor.
> 
> Signed-off-by: Sam Denison <dev@denisons.org>
> Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
> ---
>  smbinfo | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/smbinfo b/smbinfo
> index 57e8a0a..a168186 100755
> --- a/smbinfo
> +++ b/smbinfo
> @@ -428,7 +428,7 @@ def cmd_fileallinfo(args):
>  def win_to_datetime(smb2_time):
>      usec = (smb2_time / 10) % 1000000
>      sec  = (smb2_time - 116444736000000000) // 10000000
> -    return datetime.datetime.fromtimestamp(sec + usec/10000000)
> +    return datetime.datetime.fromtimestamp(sec + usec/1000000)
>  
>  def cmd_filebasicinfo(args):
>      qi = QueryInfoStruct(info_type=0x1, file_info_class=4, input_buffer_length=40)
> -- 
> 2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Decimated subseconds in smbinfo filebasicinfo timestamp output
  2026-01-25 19:26                 ` Decimated subseconds in smbinfo filebasicinfo timestamp output Sam Denison
  2026-01-26  1:05                   ` ChenXiaoSong
@ 2026-01-27  0:11                   ` Steve French
  1 sibling, 0 replies; 3+ messages in thread
From: Steve French @ 2026-01-27  0:11 UTC (permalink / raw)
  To: Sam Denison
  Cc: ChenXiaoSong, Steven French, linux-cifs@vger.kernel.org,
	samba-technical@lists.samba.org

merged into cifs-utils for-next

On Sun, Jan 25, 2026 at 1:26 PM Sam Denison <dev@denisons.org> wrote:
>
> Okay, like this?
>
> I’ve attached the patch kindly written by ChenXiaoSong, if I understand the intention this is simply to allow me to take credit and do little to no work! I only edited the dates and times in the patches header and examples. I haven’t ran a single Git command! Hope the patch still works.
>
> I’ve CCed linux-cifs@vger.kernel.org and samba-technical@lists.samba.org as requested
>
> Sam
>
>
> On Tuesday, 20 January 2026 at 15:40, Steve French <smfrench@gmail.com> wrote:
>
> > You can send your patch as an attachment to us, you shouldn't need to change your email address or worry about smtp.
> >
> > Thanks,
> >
> > Steve



-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-01-27  0:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <n3ma17AT6PhgrI6OfkbdTz3n_ak9jHfcYoGaAOdyxsY63h-GVDNpzS98XsQlTPN6r2nYxdQ_ODsxNX7fPh8J0PpSJ7-Tvt_8uqjtpfQamGw=@denisons.org>
     [not found] ` <hrQNBHikNUU26Klip-roC5Vuq474cWlMtfx-yvROP7k6iAyEW66dCc8negCRm4xdOuRqAQDa346BJQKyFLl3HveGykv-jkKihJarU5MYpFQ=@denisons.org>
     [not found]   ` <f147af48-6c01-47f4-ba51-71b77c1ea94a@linux.dev>
     [not found]     ` <Sj-xdM9FhG-h2q9G9x6pAEQN2TZEyWvq3Vh66-KRyGXnoDxar4KfSmsStO9n2mWnJgez0zqgn7STXBXjedgRKRLs23ql190kfqKNrl1J48Y=@denisons.org>
     [not found]       ` <LV9PR21MB4757D8624474C50468BEAE81E48EA@LV9PR21MB4757.namprd21.prod.outlook.com>
     [not found]         ` <LV9PR21MB4757E63CE7D0DE2610AF2655E489A@LV9PR21MB4757.namprd21.prod.outlook.com>
     [not found]           ` <50b282c2-6a06-42cc-b52e-b545fd8d9e01@linux.dev>
     [not found]             ` <hAshiKr_dint37zHnaRbpo9UNdT9my5xllqfyLLXWYZR5jpRVn2lpTvzgWWng3w-INoptu8YHCUMVtda0JV-ekS3zNGePJgJMqL3wKw6HWQ=@denisons.org>
     [not found]               ` <CAH2r5ms02k4feJEmfzenU-DgFMSDFDiCc1=o_JpyaiWcnOU1Tg@mail.gmail.com>
2026-01-25 19:26                 ` Decimated subseconds in smbinfo filebasicinfo timestamp output Sam Denison
2026-01-26  1:05                   ` ChenXiaoSong
2026-01-27  0:11                   ` Steve French

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.