From: Petr Mladek <pmladek@suse.com>
To: Hungyu Lin <dennylin0707@gmail.com>
Cc: rostedt@goodmis.org, andriy.shevchenko@linux.intel.com,
linux@rasmusvillemoes.dk, senozhatsky@chromium.org,
akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
keithrteeple@gmail.com, stable@vger.kernel.org
Subject: Re: [PATCH v3] lib/vsprintf: Preserve the sign of seconds in %ptSp
Date: Tue, 10 Nov 2026 14:20:34 +0100 [thread overview]
Message-ID: <avMaIj0DGI9yei5O@pathway.suse.cz> (raw)
In-Reply-To: <20261109215445.43419-1-dennylin0707@gmail.com>
On Mon 2026-11-09 21:54:45, Hungyu Lin wrote:
> The documentation defines %ptSp as equivalent to %lld.%09ld, but
> timespec64_str() formats tv_sec with default_dec_spec, which does not
> have SIGN set. Negative seconds are therefore printed as unsigned
> values: {-1, 0} produces "18446744073709551615.000000000" instead of
> "-1.000000000".
>
> Negative values can arise from time differences, for example in
> fnic_get_stats_data() after the realtime clock steps backwards.
>
> Use a signed decimal printf_spec for the seconds and add printf KUnit
> coverage for zero, negative seconds and the signed limits.
>
> Fixes: bccd5937447f ("lib/vsprintf: Add specifier for printing struct timespec64")
> Cc: stable@vger.kernel.org
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Tested-by: Keith Teeple <keithrteeple@gmail.com>
> Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
The patch looks good to me:
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
I am going to queue it for 7.5.
I am sorry that it me so long to get to it and missing 7.4 merge
window. My TODO list somehow exploded around the Plumbers conference
and I am still catching up with it.
Best Regards,
Petr
next prev parent reply other threads:[~2026-11-10 13:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-09 21:54 Hungyu Lin
2026-11-10 13:20 ` Petr Mladek [this message]
2026-11-10 13:25 ` Petr Mladek
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=avMaIj0DGI9yei5O@pathway.suse.cz \
--to=pmladek@suse.com \
--cc=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=dennylin0707@gmail.com \
--cc=keithrteeple@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=rostedt@goodmis.org \
--cc=senozhatsky@chromium.org \
--cc=stable@vger.kernel.org \
/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®