From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (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 4CCEE1367 for ; Fri, 22 May 2026 11:02:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779447745; cv=none; b=uD4aKDjTJtimJE29R81a+4lNj32Wk1ru1bAnaxiyrLv+SN2ma4YFiqgoYDr4uA8OOI0M4ZopwI2IiPPBdWWVfryU/1BOvQ14vnJNMjADbAADQL9zzClSKBiDYEQ7hJlJjDxfUqdwN2TqtX8kjaHHuEqG6yBZ5Qa2NfnPoaSwaiI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779447745; c=relaxed/simple; bh=HjcRq1lGbTiZ/1JJ40hbmU1JymlezMGSDUOj1hBKe/g=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=tPELNdSHYcYMcsVgyIB98aA5g0WkO0ItlfZlwYRQc/VLtr6kGeTTNhHAh0nPHS1vu0ZxEoPU8qYwuLFifODqsNxuq3j74DF/1iRhQQ1QpDXoCzEW7OvZHGfkLw5ash1c1BLO3u+N8X8YyyT+5vpPGRZmrkxiM9UsIblW+O9wnPo= 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=JeKtsEzE; arc=none smtp.client-ip=209.85.128.43 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="JeKtsEzE" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-4903997fcb5so17395525e9.2 for ; Fri, 22 May 2026 04:02:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779447743; x=1780052543; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=HjcRq1lGbTiZ/1JJ40hbmU1JymlezMGSDUOj1hBKe/g=; b=JeKtsEzEFt4ji4VtfK7F74GAKj0AbQ4Y4lbYGHGikc8zhmIcqVx5F43k3T1JeG5CaI o/bjcc1+eBFSykThiqp81OEsyreXY3ZIyffaOqrV7WGr2WUcbdDc+jS5GbYxWziz7VHm cJ7+6UUb8bU5O9jUBmFTfAQkblulo3D9L69ds0fjDQudh1d72pbwpEmAv572ABrRnzDx PqQwk4rNBNHMS2rH/2gMGRg0dFCOesfTLZMUnnqnE4eJWBnZbUdcVF9K5ysWBWz0YxET U9QnfXnI3Df4EBcZXOy9e9RnZVKir9dcLzytg0SRlUrpy3HA0gNskQsvBQb33EU4p/8r rn+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779447743; x=1780052543; h=content-transfer-encoding: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; bh=HjcRq1lGbTiZ/1JJ40hbmU1JymlezMGSDUOj1hBKe/g=; b=O2dzfh4nCvBvIiQe4CgRiyq8ehwiCSO9l9zDjFNPIqr4BotiAM4kjZdaU7gfra1HIc HsvnlgVHSCMXZ+s1wLa+jzAyG3ledPEnFxh0Utrdf5KVafr1MoB38jYQeezpRRYZYAze 0bDO0QTz8WoglmYFH8hQWPraCSL4cz6m+svJMnYuYN9ZaniocFqqpMfjcsbXPvSj6FkT C7er5k3o0wvhf/X1X+hrM/eNr8odAKspOhr6smWoL3BfaJTwI4HkwXM/5wXLeG8AHxzS iUV1phYcN17p2bdSJQIpJ0T3wz4vB8fl/BzEhQNKyrzwDQEjmNFgcmY5PN4l0VOy59Rm Cc4A== X-Forwarded-Encrypted: i=1; AFNElJ9cgB8qGr1mwNKXkGL1p3qenBaSlu+LMvZNzC9/RCvLNOfDzd+Qlxy7kxFTr5ELtrsPT/BnwnSD+4541Tw=@vger.kernel.org X-Gm-Message-State: AOJu0YxERB5qmwaPNzDxhSmJD14M0P/cr/mkY2t5t0RJoBbd4oshGxLT LneMyEnSyaPjRxeO30GKzgCSzNRzlkblY4QaNlC76XETxUmC8ZO3YWY1 X-Gm-Gg: Acq92OFRSaTOj9k1aKUvakqzhSO7fk0cuCdnIhXVmrB11GgCbxOiuZvkgT2GyGTP5eM +ZvNeMt4u/D5Ez1yNigERRuTz+3569nqmINxy6QTqrkErrs1C/Tch0EhkDnykNobY8imyeKzEij VTSbqyQJ5JoivG9s0jE4cosmb40+YlXNlvk7KYIj7Na9nUrVDNs1Np60m1ce4Y58OVUDRTrwPcf oic9DmivoqCasCYDk6oKRkEqffGUvSq+ZQt2dHTykSmYhh2vOu9+fZQoAa4+40k3goeDDtbMBGu 4CV558pHKpD9HD7WeYdHY8jBbgtIsvbnjZqxv/hky1/d/x5Ifg1YEe6kNrbinU4bD8H2XDmiFS5 UGEjhazYQ7cYVZ5Cqc+hBG6wNI3b2mnwqHnqvhYcGAva6qYuWBdvflRvAFyfLhKFN9Y3S7c494w y+BCQpQuEvbcgVfUcsuHmUWFwx/bMntRJLQvJDMeSYqnN5bO3dmxwAlXVTm3Avq7x8 X-Received: by 2002:a05:600c:5298:b0:48f:e230:c3fb with SMTP id 5b1f17b1804b1-490428ddd40mr40608625e9.33.1779447742457; Fri, 22 May 2026 04:02:22 -0700 (PDT) Received: from Abds-MacBook-Air.local ([2a02:3037:612:951:d06e:b718:93a2:5b39]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49042aec059sm15945285e9.28.2026.05.22.04.02.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2026 04:02:21 -0700 (PDT) From: Abd-Alrhman Masalkhi To: Yu Kuai , Xiao Ni Cc: song@kernel.org, xni@redhat.com, neilb@suse.com, shli@fb.com, linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org, yukuai@fygo.io Subject: Re: [PATCH v2 2/3] md/raid1,raid10: fix error-path detection with md_cloned_bio() In-Reply-To: References: <20260501114652.590037-1-abd.masalkhi@gmail.com> <20260501114652.590037-3-abd.masalkhi@gmail.com> <71990de4-1113-4b7d-8a50-ca1d82802a03@fygo.io> <4ff43e8f-6405-4ce8-8cdf-f71e0bce4d3f@fygo.io> Date: Fri, 22 May 2026 13:02:18 +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; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Fri, May 22, 2026 at 12:23 +0800, Yu Kuai wrote: > Hi, > > =E5=9C=A8 2026/5/21 17:14, Abd-Alrhman Masalkhi =E5=86=99=E9=81=93: >> The original bio resubmitted via bio_list is not executing in the raid1d >> thread context, so blocking on is_suspended() is correct and will not >> cause a deadlock. The suspension deadlock risk only exists for >> md_cloned_bio executing in the raid1d thread context in the error path. >> And in this case it is always true that if we are executing in the >> raid1d thread context the bio will already be a md_cloned_bio on entry >> to md_handle_request(), even if current->bio_list was set, because (and = as >> @Xiao has mentioned) every time we split a bio in the error path we are >> resubmitting the md_cloned_bio remainder, never the original bio. > > I do understand this, if original bio or resubmitted bio only split at > raid1_read_request, there is no problem. What I feel is not safe is that > bio can split somewhere else. > > This is possible for raid5, However, take a closer look at raid1/10, I > feel it's not possible for resubmitted io to split in bio_split_to_limits. > Even if it happens, it's probably someone else to blame. > Agreed. Since bio_split_to_limits() has been mentioned, I am wondering whether a resubmitted md_cloned_bio could end up being split there for raid456. I have not looked into the raid456 code yet; after finishing raid1 and raid10, I will move on to the others. I am considering skipping the redundant call to bio_split_to_limits() when md_cloned_bio() is true. However, I am not sure whether this would be safe for raid456. > --=20 > Thansk, > Kuai --=20 Best Regards, Abd-Alrhman