From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.127.231.42 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795233575; b=j6kuOwrZqrENXah+GH6ampjEv/OQOcV20amzMC0gw+tTL+Oeq2UK0/w35Sert45JF87Z fyK09a7MEqkdv6PvlIVL85ROdD0wFm9Bs7KuKfUWG/ZksmF3IQK5kGcw5v5mQv8GWU1ve w2OH7o9quWO4sbJdLfXJy3dLdmWSFRwwqu7zVj0dVSE3hX+qQRDl1kZIGs3kRKSVt3n/W 5UXBnvc6SZnQMhHf7/tJJL4YvLrfCXSIgphoRPeRxjvDGp+XU5wjtc2yYVFaRXoBiQo/R gHr+NdEkdaXrg+FBXl467E9t4qMbXdF5xoedZrH98YZYhqSSDcGPDQTiIZTsuVIsN1w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795233575; h=DMARC-Filter:DKIM-Signature:Subject:Reply-To:From:Date:User-Agent: Mime-Version:X-Original-From:References:Content-Transfer-Encoding: In-Reply-To:X-Lms-Return-Path:To:Cc:Received:Message-Id:Content-Type; bh=Ecje+ICZ2y4kOi3FzWBZvMRUmxKj66g4Uste2s+ql6U=; b=QLjtliu6FisYBpxA2EeBwzeiI89rAmxKJlA3MI0/kG0vYvHC4Bf3NgLFUkD9+HiwzIty rhDF6ekYWY6SAIb4K8wx7wRtX5Z0zeQhuZddUQ83AjuZGM84EIK1xvMfnlAQDvsnc5LrU 9Ad7Dbh3X7NR9SCr/hMazfqc1ZJHDGB5lKZo0ZRPUIk4jqKxd9fIfO24ctiMt/WKMJC6R fVfC1eE/iyh7D1/7V9YyMnztooJarD7tKJSjxuOh6JruAc6iCHDMQrzdkCYL7B2AzRuOE MPegnf6+NvSF0rJGP27iu5/1d44pVCy1WtEHxIaqFvybrib9KvBPtrga52FBMW2rQ2Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=fygo.io; spf=pass smtp.mailfrom=fygo.io; dkim=pass header.d=fygo-io.20200929.dkim.larksuite.com header.i=@fygo-io.20200929.dkim.larksuite.com header.a=rsa-sha256 header.s=s1 header.b=WmzBx7wX; arc=none smtp.remote-ip=209.127.231.42 Received: from va-2-42.ptr.blmpb.com (va-2-42.ptr.blmpb.com [209.127.231.42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F09A5606A692 for ; Sat, 21 Nov 2026 03:59:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org F09A5606A692 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=fygo.io Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fygo.io Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fygo-io.20200929.dkim.larksuite.com header.i=@fygo-io.20200929.dkim.larksuite.com header.a=rsa-sha256 header.s=s1 header.b=WmzBx7wX DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=s1; d=fygo-io.20200929.dkim.larksuite.com; t=1795233564; h=from:subject:mime-version:from:date:message-id:subject:to:cc: reply-to:content-type:mime-version:in-reply-to:message-id; bh=Ecje+ICZ2y4kOi3FzWBZvMRUmxKj66g4Uste2s+ql6U=; b=WmzBx7wXxcoahtCOrfQ9kpQTdmlyTnrTuj5EnU1DR4uhRQDmyx58qA08GhdDOypHNztybW qi3h2xW6gVLaEydNTnJ8wTxh1xScjrsFxcukSlUyO3gLOvGDhw/39nkRjx9QKvWuJ/j3Wh UjfobUQvswd4b9VbFZb7QPBm4vVChcSokxPWn31OhcI+u/+F972+supTCABBh5MLSMAXq3 7GYFCkVCJbC7awFjAdthMyx+vGzTyy2r04qjr6Xhgo/d15uPabFxPkQnsBqVsEMV/AanRV 4+TsTrEpb2q+6LrJSaJsSXrl/uB/4xvsMdW2hjL/kaaBs8k4FZcV0OPu/5+93w== Subject: Re: [PATCH v2 0/2] md/raid5: fix PPL disk add and replacement removal Reply-To: yukuai@fygo.io From: "yu kuai" Date: Sat, 21 Nov 2026 11:59:19 +0800 User-Agent: Mozilla Thunderbird X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 X-Original-From: yu kuai References: Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Lms-Return-Path: To: "Yingjie Wang" , "Song Liu" , "yu kuai" Cc: "Li Nan" , "Xiao Ni" , "Artur Paszkiewicz" , "linux-raid@vger.kernel.org" , "linux-kernel@vger.kernel.org" Received: from [192.168.1.104] ([39.182.0.159]) by smtp.larksuite.com with ESMTPS; Sat, 21 Nov 2026 03:59:22 +0000 Message-Id: Content-Type: text/plain; charset=UTF-8 =E5=9C=A8 2026/11/15 15:39, Yingjie Wang =E5=86=99=E9=81=93: > This is v2 of the two independent PPL disk-transition fixes. The first > patch is unchanged. The second patch also handles a slot that remains > assigned above the current array width after a RAID5 shrink. > > 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. It also skips log_modify() when removing an active device fro= m > a slot at or above the current raid_disks value. Such a slot has no PPL > child log after a shrink, but its device pointer still has to be cleared. > > Changes in v2: > > * guard the active-device log update with number < conf->raid_disks; > * add a shrink test that leaves an extra slot blocked, enables PPL, an= d > compares the v1 and v2 removal results. > > The v1 public thread is: > https://lore.kernel.org/r/cover.1794215128.git.x-professor@outlook.com/ > > Tested on x86_64 with KASAN, PROVE_LOCKING, DEBUG_ATOMIC_SLEEP, LOCKDEP, > MD, and RAID456 enabled: > > * per-commit W=3D1 builds for both commits; > * failed PPL disk addition, which reaches DONE on the v2 tip; > * unpromoted replacement removal, which reaches PASS and DONE on the > v2 tip, with tracing observing `ppl_write_stripe()` and a successful > return during a subsequent array write; > * the shrink comparison, where the sent v1 remains at slot 3 after > three remove attempts while v2 removes the slot on the first attempt= ; > * empty-header `-EIO` injection while adding a spare, where `slot=3D0` > returns an error, leaves the slot unassigned, restores `ppl_size`, a= nd > leaves the degraded array writable. > > The runtime tests use native metadata 1.2. IMSM external metadata was not > run. The empty-header failure uses a dedicated kernel with > `CONFIG_FAIL_MAKE_REQUEST` enabled; the separate page-allocation `-ENOMEM= ` > injection was 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(-) Applied > > > base-commit: 47e1b18f38d74015cb9fd30b5ff2a1eb88e77d31 --=20 Thanks, Kuai