From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C2BF63F4DDA for ; Thu, 18 Jun 2026 12:30:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781785805; cv=none; b=C8AzytwHziqdios7WySmOvP49GkrjlUKFRozPT5hFZhMjrC0TX3detG3aFgIA+ICGGNZcF6+6IJQRogFCMSIF7SDoiLJNtgfUHk7mjbLPezJozqDXOQ3k6kt1I4vUO1T2YHRs2nCeUfWSWm/KwFn40ROlKNgi/Dj36meldz5bA0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781785805; c=relaxed/simple; bh=us6aWQv+NOojHffFKNtqL2Z0EuqrqXHbfK46r+SN/uE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=SwaZWar/xRnFOLPobBccgeiFXYSCP1jsAFQcBM2OYz+WxFM8u74IiRr04eoHKaD4A6wh8Kns+lIFqzXY27G9F0m9O6G1ythPbDOptFS1DnI3mqaFoR4ynebU1djYtdBFDsf3xTj4CYP07QWujvpU1A59wULPPeFfEd483mqtYRc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=h89A12gc; arc=none smtp.client-ip=209.85.214.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="h89A12gc" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-2c6c57c5bcfso8131445ad.1 for ; Thu, 18 Jun 2026 05:30:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781785804; x=1782390604; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=8LxzgycV+PsauZ3FIIeSvMojO57zf/VejVA2nQhQe4g=; b=h89A12gcU175qLFwxcfpdPu7mA9QkLhvL/M2yZo2U69dQZcvV/b4aAmS1OkCNNlhGK haXPvlvupeFlTLZJz69FVeQLDdhhpB2u7PdRZ+Td0UaZ2X7f7bI52P7qdB1gvGAvasHD 6/SlMj5NMg5H78bfTmtxmAmzOlMxszh95joLJmii52LRRIrmd/ohFr90kyqZPtbC2Ph/ V+MmCMToL8aQbfsngwrCzHhX2lIscAaR8Itiyb1YPZ7up0oZsm+nexQrzTs97j975Qif vhwrDJymEdk2OCCoFXHFGdnHqZ4/MmVsvGzoPI0P2Aa4SN65OcZZIgIceZ612UDzi6tz enNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781785804; x=1782390604; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=8LxzgycV+PsauZ3FIIeSvMojO57zf/VejVA2nQhQe4g=; b=WBUl4my38yDuVZtq3MAlQz4mK5qQaIYQLVTNV6Ek/yv9U/l2kREjh+BLZg3nuoHzHi L7pkvJ/mb3x3QqHGD79al4PSQKns8YIcoR/YK+AAm79CfyV14gvetM+e0S87DNhjHdvE 7u3rtAMKyh/vlcieDqyfBS3nURBQrr73ayi+AQlKAJbXCl83pZVj2joylvoJoUi9M8kA LTCSzqrEK7WW0wr1yQkNnMnRPGG3VWXVuYAFSCBkHLKCijbEnpIuNEQwBIIo8ejmRW19 bo6guwncpbJw3O+bOUglso7sCfhu9naN97opyiFDSdWPli1mfts7hjpS7+7cUb3TdQNV h/AA== X-Forwarded-Encrypted: i=1; AFNElJ+vRM6wNJQjJDRmyAEQ0RUbzWqmG9sV3d812ZWIdczCqTcqZ4AXj5l+ETDeW0Dx68tiOjIIiKM0VXG9OS8=@vger.kernel.org X-Gm-Message-State: AOJu0Yw2M7HRA2ntmbQvLhglD/7M0r77KthMMEKlv2Tm6Pm3KJ94SXII Tg5blmFdRPoeUQ0ufUZwNtlxvleXDaxpuL+FpN/BP2UpTA6LbjBJbR1a X-Gm-Gg: AfdE7cmgpYF/JGLkdjlcZTwIUZ6GfdkJGPNkbxoQ08qZximGEJkXvyG7ROQ6vYYlRlG 81U0J+yu1KdgjT+nqaDemYFXvqtDfdGhu7E+lzWV+ci41ChGZZm4a6Czmiaq6Fc3r8a5uIsFlQY aoRN+cWREWw2EGkU+a7JUJxkj9JpRdj+0YJIdmbLA5QZ4zWdcy5YQGICv7VSTXj6fMjPSqesUFP m02+sMVJfoDz0nr/M2e4TtcwTe0u4w8wE7xstF5m8AVox3Z4vOLNrN6orRowS+8eR218G8H66qe nSZiHiyuv8pqopGg69kVvAKuhTCVqvRy84Mu5vvvmUO0ru36Z4csbUwTqBCNjUmmiAC7o82NdH9 cGhHhg64+3i9ZzqhE3ZRh4PNEtDi2Cda4oKYJZuZ60S/vkavTvHwEpr0yTCRRvAlOKQZXfJBq4e WNp6D9iBjkDODRR4kLo1UhT6VCEz290+Cb83QAToHnzPDe0SU= X-Received: by 2002:a17:903:11d1:b0:2bd:606d:b339 with SMTP id d9443c01a7336-2c6bc221f57mr85979705ad.21.1781785804077; Thu, 18 Jun 2026 05:30:04 -0700 (PDT) Received: from [192.168.8.62] ([154.83.91.239]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2c6e54e823esm32973845ad.72.2026.06.18.05.30.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Jun 2026 05:30:03 -0700 (PDT) Message-ID: <9bc752e0-06c0-4960-aac3-0c932bb07298@gmail.com> Date: Thu, 18 Jun 2026 20:30:01 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] md/raid5: protect batch_head->bm_seq updates To: Paul Menzel , Chen Cheng Cc: linux-raid@vger.kernel.org, yukuai@fygo.io, yukuai@fnnas.com, linux-kernel@vger.kernel.org References: <20260618065544.954309-1-chencheng@fnnas.com> <5e6ce9e2-4da9-4ded-be8c-fad3ee153d90@molgen.mpg.de> <76dd7a7b-b1ad-4f61-9eda-5957f712ed87@fnnas.com> <946e31d4-1ea8-4c65-be0a-0f942a9cdf8c@molgen.mpg.de> From: Chen Cheng In-Reply-To: <946e31d4-1ea8-4c65-be0a-0f942a9cdf8c@molgen.mpg.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 在 2026/6/18 20:15, Paul Menzel 写道: > Dear Chen, > > > Am 18.06.26 um 13:26 schrieb Chen Cheng: >> 在 2026/6/18 18:36, Paul Menzel 写道: > >>> Am 18.06.26 um 08:55 schrieb Chen Cheng: >>>> From: Chen Cheng >>>> >>>> bm_seq means "stripe delay to flush until bm_seq <= seq_write". >>>> >>>> do_release_stripe() keeps STRIPE_BIT_DELAY stripes on bitmap_list >>>> when bm_seq >= seq_write. >>>> >>>> after raid5d() flushes bitmap update and ++seq_write, and >>>> active_bit_delay() retry to release delayed stripes. >>>> >>>> the stripe batch head must carry the newest bm_seq among all >>>> member stripes, because the whole batch later released according >>>> to the batch head state and bm_seq. >>>> >>>> race scenario: >>>> =================== >>>> 1. cpu0 - sh0->bm_seq=101; cpu1 - sh1->bm_seq=102; >>>> 2. both cpu0 and cpu1 read batch_head->bm_seq = 100; >>>> 3. cpu1 write 102, and cpu0 overwrite with 101; >>>> >>>> the point is, if the head has a lower bm_seq than one of its >>>> members, the whole batch could be released before that >>>> member's bitmap is flushed. >>>> and the on-disk bitmap not record sh1's changes. >>> >>> It’s a little hard to read. Could you please improve the wording of the >>> last paragraph, and maybe also start each sentence with a capital >>> letter. Maybe also use 75 characters per line. >>> >>> Do you have a reproducer by any chance? > >> Thanks to review, and , I will follow your advise. > > Thank you for reading my comments. > >> Actually, I have some reproducer to hit KCSAN reports in RAID-5, but not >> for this one. Because it's reported by sashiko-review bot, and, I think >> it's a true risk. > > Maybe also mention sashiko-review. > >> I will try to make a reproducer for this case later, after I figure-out >> the other KCSAN reports. > > A reproducer is not required, I was just interested, how the issue was > found. So don’t spend too much on it or at all. Well , I think a good reproducer has to be : - Concurrency as much path as possible , e.g. reshape concurrency with normal I/O, etc... Optionally , - Run some Sanitizer, - Inject some fault, e.g. bad block, write error, disk drop... - Provide some background I/O pressure, - Do some combinations describes above > > […] > > > Kind regards, > > Paul