From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-189.mta0.migadu.com (out-189.mta0.migadu.com [91.218.175.189]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 16FBF487BE for ; Mon, 26 Jan 2026 01:06:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.189 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769389585; cv=none; b=bKsuDK8pO14sTvJgekUBg0T/Bm5ipZyJl38kLiIWJehBRiClNqKJxQUAkTbILUvOhlpTL6OR4cHNhReLAMyAkntWPAKlbGLRGG4Drgs40v/OdslM9IxoNxYUaTVFNdYk9FAE2Iz/8IICqQWq2BYKnawJTfpKoLkVW41Den6OEJE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769389585; c=relaxed/simple; bh=/47TYBrga9IeIm0khcfVs19o8N+gdIMJ/AX5PYO/N28=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=JZVRwyKSPoPxo7yxz4ja6NNwN20wetOdd22Wa/x9BRJvh42J4GOcAySaJ2mKQegQBSKomdm7OzIOFyLC0f7rU3CEXTvbfP/luMLKSvE1IeHsWxeoapBKytMdovQpsdzrk+fGFsNx55zJRcSKVaxGNY6fgeFvDEHINmQqjBQmosg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=YZpD2zV6; arc=none smtp.client-ip=91.218.175.189 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="YZpD2zV6" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1769389580; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t/WgvXxTG03zzIYztM1YjVL8bEbGZbcXzqgLSgsGDKI=; b=YZpD2zV6Bx5oqGUtNwmPJSLo9U+hJujHQHUHc5frQE5trzH/HB31NOtCfM+izfMKVVqJRO Y6TlqgymyI3Mo1OyGlyIu5nqX/VY+mY8R2tqeY2VNRg4FNfijZhIgCBHLg+4KJqaWQkImK U+XoPAAwp1qXE+JFCfQTSi7H69x54D8= Date: Mon, 26 Jan 2026 09:05:30 +0800 Precedence: bulk X-Mailing-List: linux-cifs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: Decimated subseconds in smbinfo filebasicinfo timestamp output To: Sam Denison , Steve French , Steven French Cc: "linux-cifs@vger.kernel.org" , "samba-technical@lists.samba.org" References: <50b282c2-6a06-42cc-b52e-b545fd8d9e01@linux.dev> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: ChenXiaoSong In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT Acked-by: ChenXiaoSong Thanks, ChenXiaoSong On 1/26/26 03:26, Sam Denison wrote: > From: Sam Denison > 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 > Signed-off-by: ChenXiaoSong > --- > 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