mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yingjie Wang <x-professor@outlook.com>
To: Song Liu <song@kernel.org>
Cc: Yu Kuai <yukuai@fygo.io>, Li Nan <magiclinan@didiglobal.com>,
	Xiao Ni <xiao@kernel.org>,
	Artur Paszkiewicz <artur.paszkiewicz@intel.com>,
	"linux-raid@vger.kernel.org" <linux-raid@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH 0/2] md/raid5: fix PPL disk add and replacement removal
Date: Mon, 9 Nov 2026 09:05:37 +0000	[thread overview]
Message-ID: <cover.1794215128.git.x-professor@outlook.com> (raw)

This series fixes two independent PPL disk-transition bugs.

When a newly added disk fails PPL setup, raid5_add_disk() can publish
the private disk pointer before the caller rolls back raid_disk. A later
removal can then free the disk while RAID5 still references it. Patch 1
prepares the PPL log before publishing the pointer and restores the
previous state on failure.

Patch 2 keeps the active PPL log attached when an unpromoted replacement
is removed. Without it, writes to the slot take the -EAGAIN path in
ppl_write_stripe() and are dispatched without PPL protection.

These fixes are independent of the separate replacement-activation work
and can be applied on their own.

Tested on x86_64 at the final commit:

  * per-commit W=1 KASAN+PROVE_LOCKING bzImage builds;
  * deterministic add rollback with -ENOSPC; and
  * removal of an unpromoted replacement, with entry/return kprobes on
    ppl_write_stripe().

On the unpatched md-7.4 base, the add-rollback test triggers a KASAN
slab-use-after-free in handle_stripe(), and the replacement-removal test
observes only -EAGAIN returns from ppl_write_stripe(). The final series
completes the add-rollback test and records a successful PPL write after
replacement removal. No KASAN, BUG, WARNING, Oops, or lockdep report was
observed on the fixed kernel.

All runtime tests used metadata=1.2. Empty-header -EIO injection and an
IMSM external-metadata runtime test were not run.

Yingjie Wang (2):
  md/raid5: roll back failed PPL disk additions
  md/raid5: preserve active PPL log when removing a replacement

 drivers/md/raid5-ppl.c | 11 ++++++++++-
 drivers/md/raid5.c     | 13 +++++++++----
 2 files changed, 19 insertions(+), 5 deletions(-)


base-commit: 47e1b18f38d74015cb9fd30b5ff2a1eb88e77d31
-- 
2.43.0


             reply	other threads:[~2026-11-09  9:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-09  9:05 Yingjie Wang [this message]
2026-11-09  9:05 ` [PATCH 1/2] md/raid5: roll back failed PPL disk additions Yingjie Wang
2026-11-09  9:05 ` [PATCH 2/2] md/raid5: preserve active PPL log when removing a replacement Yingjie Wang

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=cover.1794215128.git.x-professor@outlook.com \
    --to=x-professor@outlook.com \
    --cc=artur.paszkiewicz@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=magiclinan@didiglobal.com \
    --cc=song@kernel.org \
    --cc=xiao@kernel.org \
    --cc=yukuai@fygo.io \
    /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®