public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: mm-commits@vger.kernel.org, stable@vger.kernel.org,
	senozhatsky@chromium.org, minchan@kernel.org,
	caiqingfu@ruijie.com.cn
Subject: Re: + zram-panic-when-use-ext4-over-zram.patch added to mm-hotfixes-unstable branch
Date: Mon, 2 Dec 2024 16:17:28 +0900	[thread overview]
Message-ID: <20241202071728.GB886051@google.com> (raw)
In-Reply-To: <20241130030456.37C2BC4CECF@smtp.kernel.org>

On (24/11/29 19:04), Andrew Morton wrote:
[..]
> When using ext4 on zram, the following panic occasionally occurs under
> high memory usage
> 
> The reason is that when the handle is obtained using the slow path, it
> will be re-compressed.  If the data in the page changes, the compressed
> length may exceed the previous one.  Overflow occurred when writing to
> zs_object, which then caused the panic.
> 
> Comment the fast path and force the slow path.  Adding a large number of
> read and write file systems can quickly reproduce it.
> 
> The solution is to re-obtain the handle after re-compression if the length
> is different from the previous one.
> 
> Link: https://lkml.kernel.org/r/20241129115735.136033-1-baicaiaichibaicai@gmail.com
> Signed-off-by: caiqingfu <caiqingfu@ruijie.com.cn>
> Cc: Minchan Kim <minchan@kernel.org>
> Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>


Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>

A side note:
Well, we should not crash the kernel or corrupt memory, in this
regard the patch makes sense, however, if data is being modified
concurrently with zram write() then zram simply should not be used,
we can't decompress data that is unstable at the time of compression.

  reply	other threads:[~2024-12-02  7:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-30  3:04 + zram-panic-when-use-ext4-over-zram.patch added to mm-hotfixes-unstable branch Andrew Morton
2024-12-02  7:17 ` Sergey Senozhatsky [this message]
2024-12-10  9:38 ` Sergey Senozhatsky
2024-12-12  8:40 ` Sergey Senozhatsky
2024-12-13  1:15   ` Andrew Morton

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=20241202071728.GB886051@google.com \
    --to=senozhatsky@chromium.org \
    --cc=akpm@linux-foundation.org \
    --cc=caiqingfu@ruijie.com.cn \
    --cc=minchan@kernel.org \
    --cc=mm-commits@vger.kernel.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