Re: [PATCH 2/2] zram: fixup read_block_state()
From: Andrew Morton
Date: Thu Jan 15 2026 - 17:07:44 EST
On Thu, 15 Jan 2026 12:30:06 +0900 Sergey Senozhatsky <senozhatsky@xxxxxxxxxxxx> wrote:
> ac_time is now in seconds, do not use ktime_to_timespec64()
Please help me out here - which patch introduced the issue which Chris
found?
> Reported-by: Chris Mason <clm@xxxxxxxx>
The Closes: link would be helpful.
> Signed-off-by: Sergey Senozhatsky <senozhatsky@xxxxxxxxxxxx>
> ---
> drivers/block/zram/zram_drv.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
> index cc51aa8b6181..912711faa4e4 100644
> --- a/drivers/block/zram/zram_drv.c
> +++ b/drivers/block/zram/zram_drv.c
> @@ -1579,11 +1579,9 @@ static ssize_t read_block_state(struct file *file, char __user *buf,
> if (!slot_allocated(zram, index))
> goto next;
>
> - ts = ktime_to_timespec64(zram->table[index].attr.ac_time);
> copied = snprintf(kbuf + written, count,
> - "%12zd %12lld.%06lu %c%c%c%c%c%c\n",
> - index, (s64)ts.tv_sec,
> - ts.tv_nsec / NSEC_PER_USEC,
> + "%12zd %12u.%06lu %c%c%c%c%c%c\n",
> + index, zram->table[index].attr.ac_time, 0,
local `ts' is now unused?
> test_slot_flag(zram, index, ZRAM_SAME) ? 's' : '.',
> test_slot_flag(zram, index, ZRAM_WB) ? 'w' : '.',
> test_slot_flag(zram, index, ZRAM_HUGE) ? 'h' : '.',