From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.127.231.47 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795934724; b=QK8WjxzieZoMdWevhP0OnrWYtxdzF1Un1sHHZmN8Ni4VxK7mpXAH3m192jqjYCgAXtqn B24O/l2nzZvlEs2nbiTFNmukuS009IbLsVDKzTGb95+aCQ/gJFfryvjoRGGLSCl/+QERb pOz/he61jeJha4Paw5KDr6ZeVsBH32wBdPfuFceZxta7Ip2Lsr8UmeDswkj6VwxidR5D3 vYq0N4j4TczA+nCfDSdHksdXxQYs+CFFrFVrbrJ8tHqkUYkOyxBCaHXt+ZspjX13DE/+e APp+D6Ms7jB44+AiAQyFhuyLkBbGOwddYIjv9KfkCkmWAJ7WnUb+YEFva9WOMNDbCPg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795934724; h=DMARC-Filter:DKIM-Signature:Reply-To:Date:Content-Transfer-Encoding: To:Message-Id:Mime-Version:Received:User-Agent:From:Subject: Content-Type:X-Original-From:Cc:In-Reply-To:References: X-Lms-Return-Path; bh=vuTybJlVkmcTQ5Vygq73t02/xMAflSKoRsSxuF5UGdo=; b=x1lcvkRDCuozD1mdJeNdbEiY2UzRCSDcbyfQSFgCFKU+B138W+oClE0EMc0aVUewh9Yh J6AlllRImuoLjEj1/UfeXC/pYld8+GnWkHDO4p7nMlvTAoGmApwGXeGc3Mn3D0WJuADWz R2KqTFUXripP6B4xkb1FHneXM6zSjfhk/jRdppxV2hozQk74UFccAFwXq6hlrQ09aoDt/ 5LK4z3qPK77MuhCT5VFFRkLD5bcjzQs+Smxc7v/QI4g7NFt9A/A55Q6BWGXAJ7DQHgFHr SJCwKjl6gUZQY4BySOFs9Z+2s2IKy4/4WrVchrRShHk1DdiA+3W6Mvb+E0KN0u2rqxQ== 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=URzvW4V0; arc=none smtp.remote-ip=209.127.231.47 Received: from va-2-47.ptr.blmpb.com (va-2-47.ptr.blmpb.com [209.127.231.47]) (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 EF293606A323 for ; Sun, 29 Nov 2026 06:45:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org EF293606A323 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, unprotected) 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=URzvW4V0 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=s1; d=fygo-io.20200929.dkim.larksuite.com; t=1795934718; h=from:subject:mime-version:from:date:message-id:subject:to:cc: reply-to:content-type:mime-version:in-reply-to:message-id; bh=vuTybJlVkmcTQ5Vygq73t02/xMAflSKoRsSxuF5UGdo=; b=URzvW4V0N7BvLdL79VVcuZndiwiNEIpMwhWPoVTeEA3I2O/lxqoLca4FA7zqPCtlT0tEHi sI2cw+6oGLgael/c22+DakMwVRTaXssReIjis9rxh/Nuavif29txMEacjpXqnXoVCB4KZW YTf4GboQL/6mEDZVulZlVo6GHjWZWf+8dooH2kDxBBiQ5om7Rt8bHrJCoWLa9iybIi/dO0 tqYBtXct7kKhwoDPlqkUsgIygadgm5fSv3QBDHOw17Tjk0sMpWHbebrzIb3EGiy6hseHU4 mf33OQCMEjuil9ewbKZ9DNfHObQZ2SiUWr+yiwP5ZU1BnbasYz2WAjYnSj6nkg== Reply-To: yukuai@fygo.io Date: Sun, 29 Nov 2026 14:45:14 +0800 Content-Transfer-Encoding: quoted-printable To: "Miroslav Cimerman" , "Song Liu" , "yu kuai" Message-Id: 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 Received: from [192.168.1.104] ([39.182.0.140]) by smtp.larksuite.com with ESMTPS; Sun, 29 Nov 2026 06:45:17 +0000 User-Agent: Mozilla Thunderbird From: "yu kuai" Subject: Re: [PATCH 0/8] md/raid1,raid10: fix writes acknowledged before a failure is recorded Content-Type: text/plain; charset=UTF-8 X-Original-From: yu kuai Cc: "Li Nan" , "Xiao Ni" , "NeilBrown" , "Mariusz Tkaczyk" , "Kenta Akagi" , , In-Reply-To: <20261127003231.1180197-1-mc@raidlab.org> References: <20261127003231.1180197-1-mc@raidlab.org> X-Lms-Return-Path: Hi, =E5=9C=A8 2026/11/27 8:32, Miroslav Cimerman =E5=86=99=E9=81=93: > raid1 and raid10 hold a write that failed on one device until the > superblock records that failure. This series fixes cases where a write > still completes with success, although its data is not safe: > > 1/8: the superblock write fails on the last working device, and reads > can return old data after a restart. > 2/8: raid10 waits for blocked devices by copy index, not by device. > 3/8: as 1/8, for a write that waited for the superblock update. > 4/8: with a bad block log, the device with the only good copy fails, > and reads of the write return EIO. > 5/8: a write whose copy fails on a device that is already faulty is > not held at all. > 6/8: raid1 can release a held write after it marks the device faulty > and before it requests the superblock update. > 7/8: a device that fails between the wait for blocked devices and the > selection of the devices for a write is skipped, and the write is > not held. > 8/8: with write-behind, a write whose copy failed on a device completes > once its write-mostly copy is done. > > The MD_BROKEN checks skip dm-raid, which does not reject writes when > MD_BROKEN is set, so dm-raid can still acknowledge such writes. I have a > fix for dm-raid and a follow-up that drops these exceptions, both > tested, and will send them to dm-devel on top of this series. The other > changes apply to dm-raid too. > > Patch 1 fixes a bug found with FuzzyRAID, a fault injection fuzzer for > RAID implementations. Patches 2 to 8 fix related cases found while > analyzing it. I used an LLM (Claude) for this series: it found the bugs > fixed by patches 2 to 8, drafted the code of patches 2, 4, 5, 6, 7 and 8 > and the changelogs, and wrote and ran the tests. I reviewed everything. > > Tested on md-7.5 with RAID1 (2 disks; 3 disks in controls) and RAID10 (2 > and 4 disks, near and far), with and without a bad block log, RAID1 also > with a bitmap and with write-behind, and with failfast: 30 fault cases > in which an acknowledged write was lost or read back old data now fail > the write, and 20 controls give the same results as before (some now > wait for the superblock update). The cases for patches 6, 7 and 8 > compare with the series without that patch, those for 6 and 7 with > delays added only for the test. All others compare with stock md-7.5. A > raid10 smoke test without faults (4-disk and 3-disk near, 2-disk far and > offset, with discards) passes too. Not tested: the race that patch 2 > closes, MD_FAILLAST_DEV, dm-raid, replacements and reshape. I don't think we should take this series for now. Device can fail at any ti= me, we should not complicate already complex error paths for extreme cases with= little benefit, specially no demonstrated correctness problem. Please separate actual bugs and keep the fixes minimal. > > Miroslav Cimerman (8): > md/raid1,raid10: fail held writes when the array fails > md/raid10: wait for the devices of the write in wait_blocked_dev() > md/raid1,raid10: fail writes that waited while the array failed > md/raid1,raid10: fail held writes that no working device has > md/raid1,raid10: hold writes that fail on a faulty device > md/raid1: set MD_SB_CHANGE_PENDING under device_lock in raid1_error() > md/raid1,raid10: hold writes that skip a newly failed device > md/raid1: hold write-behind writes that failed on a device > > drivers/md/raid1-10.c | 12 ++++++ > drivers/md/raid1.c | 83 +++++++++++++++++++++++++++++++------- > drivers/md/raid10.c | 92 +++++++++++++++++++++++++++++++++---------- > 3 files changed, 152 insertions(+), 35 deletions(-) > > > base-commit: c526b7cd32f75fea6021ffdab287b81cf38ddeb7 --=20 Thanks, Kuai