From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 5E49E435A92 for ; Wed, 15 Jul 2026 10:05:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784109942; cv=none; b=h4bRUWVm+0xVrAKynoki+dFuPuexrPm0P5lgRhILbMCbMyqyPmxYr49OEe1u/h6jKH8bfAsHyFEe3H6yYTAcCIi/RLzUh3c9PBeyeliUgPjNxTrB1jVask4l7hFjrZc8RT78ZkzWsosWObwJUBcAWmXxJAt0vjeiw+oPqZzj3J4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784109942; c=relaxed/simple; bh=Ux0F0Qhdjpc3kA+spVxS3uX+ga8tQBOxTm/Q/+IrdxA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=YX8V0vpC59awaXDIO6fyicqrUuf48CH4JK1mvik0OyodHCfidmzMW/txzV3AMqvo+3IwGpwzq7zawipn2mQ0CqxiH9AiKtNzsUVB1fQJ2NjpiT2Rzqlx2tS60OQi52hlCAwpPWVFogp5Cm/15FI99Rk/KnnJgTgepe8NhKFssGI= 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=sFOO2xLF; arc=none smtp.client-ip=209.85.128.47 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="sFOO2xLF" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-493ce08a75bso20979525e9.1 for ; Wed, 15 Jul 2026 03:05:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784109939; x=1784714739; darn=vger.kernel.org; h=content-type:mime-version:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to :content-type; bh=0gm93EXu8tVWP7J4vvZFy9rPp6hlCa+L3OB3X8B0H68=; b=sFOO2xLFlE6DP/M1Myqhld/AwJnIbT8q5gXa40Kl7YrF6WMRhxRpuVqYpWiSUYensT pPn9lvuAJcw3NrqWJ4z11NuJ0bae/EupVlENPZbBVFAFppkxs5k1NZUH2MIkprY9KK5+ 7EC+BpJnd8YwUZk5naiQm3/CGjzFY1eWYpkXcrrQZCcsIuPoqEdDrBpc4jxhQXT1rIeK VGCQW6FK5cZxMvFreM2VSt45NpeuXjRoZ+aN480E8qC8EINtP6HPDeg4Cnz3TU5YE2BH PAm7SqOqtPmP5dEcNIHM2erfqRqTO1nhl3UHdS7GMeWUHolDvqMak+xaftiZ3/P3kW1a y4Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784109939; x=1784714739; h=content-type:mime-version:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to:content-type; bh=0gm93EXu8tVWP7J4vvZFy9rPp6hlCa+L3OB3X8B0H68=; b=NRBawKFMCKlH3BDi1qdQdP6Ci6sG1OT3ZDtiLZ3x0yrekKmabZQEjJERhAtXrcvnDI u3rth8RV9OQHb0iK8x0Yy1ZiaYm7r5DxnEFdUM1FCeh9nZgjpx1EkRLgP/xS2hsw3J34 /1VF7FQHMnByhqvPANO59RjC2KiukoD3sOFnw7jqrP3eIwE4f/Yvo9WBkqdFhf+ap/pj fqBs2t3Id5NLJ+iJnPGvUlTczPvGUB7OrVBccPNOk3N+DVhhqLnP9PSVmwYuPew/Dyen 7gSfOxGXVbynY3JRl7jgm/5RN9LgSK4iGM1bIdhqn6cbEV1vVHiN/hJ2q8GmBRj5Sfk2 K5lw== X-Forwarded-Encrypted: i=1; AHgh+Rph71pzTdBPEZtx2glsu6cEmdMr5lTkaH/HlAf6E0RW54vN3mP9Amd9tR/xnDEXvLIAdXrnR2EjFo9or/s=@vger.kernel.org X-Gm-Message-State: AOJu0YzYSkNGi5ZOiciFAKJZEn8Vk1Dh/amALiD3LlVjRea2+vg4j8o3 fek0vrZ3daTAHRwpC6spaye2md4mT+vMBL4J4THf2BSm+w+6P3acJsJi X-Gm-Gg: AfdE7ck1uoEs7QtoidhlTSQ0syzroeyEIzcfm6PC64OfBBGsL+1PkaoXHDXzpYfuFVI XDHqQykMFfET4QN4i4oF+P5Pz2dPQXwTTI+rcFydYVRmpGQ+7N1IwUBagaIXroEY4LatrHkDK0c sn3zN7HcVgycgBtO5FQLiCxIwlbMDnyje6XZkgk1sP5ctx8rROk7tbspxCXIZDkfkoQR2CwK8WI pjtPZrTJE0KPfpo6Bf+2+0tn/jv+ivdZbRHWanDAOm0RW4MsZhddBXrM70/Jh7iyhsgjpa9PDad NnXmgEF3go07XtlICRC3WZffV6/o85WH7nHKO1JjITU/mTp3ZHFq3Xofj+DQ3XFMc9Sh1I2wFUw mInqkTX/3NqDQYBUIoTOIO4ABFJZuxKfn9q7c8Soemt5BsCMeUj5uT4ZvSODmjqlmRCYPdLI5yw NfI0HXRMu8mMGUMvFqlRF6FZBy7D5uRPv36GO6wgcPrzdCqU4JfM+/o9M= X-Received: by 2002:a05:600c:1f90:b0:493:f29d:d591 with SMTP id 5b1f17b1804b1-4951832618amr73205035e9.39.1784109939257; Wed, 15 Jul 2026 03:05:39 -0700 (PDT) Received: from Abds-MacBook-Air.local ([2a02:3037:666:1871:58bc:7d51:1d31:ba60]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-495087366c0sm253289385e9.7.2026.07.15.03.05.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 03:05:38 -0700 (PDT) From: Abd-Alrhman Masalkhi To: John Garry , song@kernel.org, yukuai@fygo.io, magiclinan@didiglobal.com, xiao@kernel.org, axboe@kernel.dk, vverma@digitalocean.com, martin.petersen@oracle.com, linux-kernel@vger.kernel.org Cc: linux-raid@vger.kernel.org Subject: Re: [PATCH v4 3/7] md/raid10: consistently fail atomic writes that require splitting In-Reply-To: <33aca226-f744-45e0-a137-1f85ab146e02@oracle.com> References: <20260710101521.1714-1-abd.masalkhi@gmail.com> <20260710101521.1714-4-abd.masalkhi@gmail.com> <33aca226-f744-45e0-a137-1f85ab146e02@oracle.com> Date: Wed, 15 Jul 2026 12:05:35 +0200 Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Wed, Jul 15, 2026 at 10:25 +0100, John Garry wrote: > On 10/07/2026 11:15, Abd-Alrhman Masalkhi wrote: >> RAID10 currently handles one badblock path explicitly by failing atomic >> writes with EIO. However, another badblock path can also reduce the >> writable range and force the bio through bio_submit_split_bioset(), > > What is this other badblock path which you are referring to? > The other path is when the requested write overlaps a bad-block region from the beginning, but the intended write extends beyond the bad-block region. In that case, the current code silently reduces max_sectors. As a result, we end up calling bio_submit_split_bioset(), which completes the bio with -EINVAL rather than -EIO. This is the same issue that existed in raid1 and was fixed by patch 2. >> which implicitly completes the bio with EINVAL. >> >> Fix this by handling atomic writes in the common split check. If RAID10 >> determines that an atomic write would require splitting, complete the >> bio with EIO. >> >> Fixes: a1d9b4fd42d9 ("md/raid10: Atomic write support") >> Signed-off-by: Abd-Alrhman Masalkhi >> --- > -- Best Regards, Abd-Alrhman