From: sashiko-bot@kernel.org
To: "Devin Armstrong" <darmstrong@tantalus.com>,
"Richard Weinberger" <richard@nod.at>,
"Zhihao Cheng" <chengzhihao1@huawei.com>
Cc: linux-mtd@lists.infradead.org, jpark@tantalus.com
Subject: Re: [PATCH] ubifs: Bound lpt_gc() retries when LPT GC makes no progress
Date: Tue, 24 Nov 2026 20:48:17 +0000 [thread overview]
Message-ID: <sashiko-outbox-231999@kernel.org> (raw)
In-Reply-To: <20261124-lpt-gc-send-v1-1-eb975487c6d5@tantalus.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] ubifs: missing Fixes trailer for LPT GC infinite loop fix in
lpt_gc()
--
commit 55a4a4fac9e4853bd36c8438d3e0d2d5af7bf8dd
Author: Devin Armstrong <darmstrong@tantalus.com>
> ubifs: Bound lpt_gc() retries when LPT GC makes no progress
>
> ubifs_lpt_start_commit() and ubifs_lpt_post_commit() call lpt_gc() in a
> "while (need_write_all(c))" loop. If lpt_gc_lnum() cannot dirty every
> node of the LEB it was given, that LEB's free + dirty space never
> reaches leb_size, need_write_all() keeps returning 1, lpt_gc() keeps
> selecting the same LEB, and the loop never ends.
>
> One way to get there is the LPT scanning problem reported in the link
> below: the 0xff padding at the end of an LPT commit followed by the
> first bytes of the next commit's lsave node can form a valid-looking
> node (the 16-bit CRC matches by chance). When this happens, a read-write
> mount or remount spins in the kernel at 100% CPU and can't be killed.
> Read-only mounts never commit, so they are not affected.
>
> Track the LEB and its dirty space selected by lpt_gc() in the caller's
> loop. If the same LEB is selected UBIFS_LPT_GC_MAX_RETRIES times in a
> row with unchanged dirty space, return -EUCLEAN. Any pass that makes
> progress changes the dirty space and restarts the count, so the normal
> GC retry cycle is unaffected.
>
> The error makes the commit fail, which puts UBIFS in read-only mode, so
> the mount or remount fails with an error instead of hanging. This does
> not repair the LPT, it only turns an endless loop into a failure.
>
> Link: https://lore.kernel.org/linux-mtd/97ca7fe4-4ad4-edd1-e97a-1d540aeabe2d@huawei.com/
>
> Signed-off-by: Devin Armstrong <darmstrong@tantalus.com>
[Severity: Low]
This fixes an infinite loop in the LPT GC commit path. Should it include:
Fixes: 1e51764a3c2a ("UBIFS: add new flash file system")
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261124-lpt-gc-send-v1-1-eb975487c6d5@tantalus.com?part=1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
prev parent reply other threads:[~2026-11-24 20:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 20:39 [PATCH] ubifs: Bound lpt_gc() retries when LPT GC makes no progress Devin Armstrong via B4 Relay
2026-11-24 20:48 ` sashiko-bot [this message]
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=sashiko-outbox-231999@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=chengzhihao1@huawei.com \
--cc=darmstrong@tantalus.com \
--cc=jpark@tantalus.com \
--cc=linux-mtd@lists.infradead.org \
--cc=richard@nod.at \
--cc=sashiko-reviews@lists.linux.dev \
/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