All of lore.kernel.org
 help / color / mirror / Atom feed
From: ChenXiaoSong <chenxiaosong.chenxiaosong@linux.dev>
To: Sam Denison <dev@denisons.org>, Steve French <smfrench@gmail.com>,
	Steven French <Steven.French@microsoft.com>
Cc: "linux-cifs@vger.kernel.org" <linux-cifs@vger.kernel.org>,
	"samba-technical@lists.samba.org"
	<samba-technical@lists.samba.org>
Subject: Re: Decimated subseconds in smbinfo filebasicinfo timestamp output
Date: Mon, 26 Jan 2026 09:05:30 +0800	[thread overview]
Message-ID: <f063be7f-7d09-4f07-9a44-7c8f1484de25@linux.dev> (raw)
In-Reply-To: <shU8wpo2oNyUu4RkVuN0VHmIES1SzKRN9in6AJDn4EKDDGwMkzl2ShJ8i-4AfFOSKDDnEhxZVGH_w8y9JxO683d_QQzMJOig7eOb0AmaFBs=@denisons.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


  reply	other threads:[~2026-01-26  1:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 [this message]
2026-01-27  0:11                   ` Steve French

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=f063be7f-7d09-4f07-9a44-7c8f1484de25@linux.dev \
    --to=chenxiaosong.chenxiaosong@linux.dev \
    --cc=Steven.French@microsoft.com \
    --cc=dev@denisons.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=samba-technical@lists.samba.org \
    --cc=smfrench@gmail.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 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.