From nobody Fri Dec 19 13:25:49 2025 Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) (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 9E0792BE63A for ; Sun, 7 Dec 2025 12:21:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765110118; cv=none; b=oQILlpURzZtCbu4sTxQunZR8Awc3g28mZs0DetySuqj5Rw1NSJFHtEWCklYQ79/OJhvnJsxQuFoTPIDNLFY/yyXyk+fWT6nOHMoSK5rpMdeH+VsrlBhbWV7zF0SdXfgvbOMtXyrt/QmZhN+ZP9+hSOePrC8YuEdYG0hiE3lFG44= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765110118; c=relaxed/simple; bh=4CeP8091EqjUK9CskNSlEn27rcVvsb9klIf5F54UFj4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=taCpMoApGenAjiHUzvURy5lcN6ayDaDxPz9+XiBhQavjAv/XDLMpUG4KcAKmaEUs1xdn846HplfKIX6LfhTBVzPImMLuBF40141aM5zKYiNyFVE8m2+jBuMVdUVhCnfqTANA9hTXgPiYYAaAUs6VpXqMospqiepoLy2BYpHqgzA= 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=Zy7D1DXB; arc=none smtp.client-ip=209.85.210.180 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="Zy7D1DXB" Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-7e1651ae0d5so2586525b3a.1 for ; Sun, 07 Dec 2025 04:21:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765110116; x=1765714916; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FDKxCQi4WubAv8KgzENdDuZ74b0CZmQcA4s08IiUA3A=; b=Zy7D1DXBBrOd+V5D73IJWoEvycklFwPBBKr6XzogyF6jQvf7ceG6VznuaXR/pHC60X KhP6cGgcU0WhaEQejhvkvbajUmWUvJg7VH7bo4BRPCbLsmM5ezWJhSZXC/DKmk7X6Rx0 XG7+MHmqK95TWXjapl6YT9quA78X+FiY6N/fe91yUq/qNUaFX1EMrTbGuI585xYoHWIe B4emYF8X5v7q4+dvPz3Nsvj8LD8H2VhImgYL5Y7IHR44JrjaiD0mSC7ryygOyt8qaZI0 PQ5tgcxOE+Vq6wjDgmiueuyPcKnCOrIptsPu9N58AhKaBn+Pqh8336YMFZ/Qxxxtzpjo R1GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765110116; x=1765714916; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=FDKxCQi4WubAv8KgzENdDuZ74b0CZmQcA4s08IiUA3A=; b=u4TxcCrba0rOjgfsoiZF8IKaC0vd6K2DNoSeBHhG2hCEVTmF6wkM6KIsEiSFUxhcnA Wc2E8qC5XM51BQLlqYrA3OjyASgVOnD14E2nAHKMv249uuqFySN5s507VYIrkIMOU/sw 93h0rAMQQpfiL6A0LHC+fdPoV+mPHvY79bcR01FPtSWBhlKOUMu8p7j0RnOlxg4bK298 3xGOgJUf0UmKf3btV37HxavihoqFuW+wr2GYZbcRgL0uTaLyxVZoZbTx1hdOBNCUXJhc 4zwjVWuzqpi+AwytbUYBHIqwx92gFU0BdDoZZZhRJehjcb7VThfa2Tza+il7oGwX4bcQ PL0g== X-Forwarded-Encrypted: i=1; AJvYcCV7tMnLOk3+ZrwJJ6/40J17Wex+VJZo2VC36BdC2uR89v6vwjbywNnNMT9u5vpEVrqAqHf+CsOCtHkDkgA=@vger.kernel.org X-Gm-Message-State: AOJu0Yw9UyPNRTx7E2Z1OWdyX5/TqgTp0Bgt7ZJ/ieRtkqUyLChMMsy/ p6I3iwtP/n6DMt1/rcS+VOWrVNm3+nHzVm2z7A3XuQhN9IKN+2g8vo8T X-Gm-Gg: ASbGnctHeZJUMgvvCKv8uIsSGlIJ4xzJOpe2xLs3qCmx96bYGdggWvmaJkEU2j4FVFc 26iaMln+tDuL3GOpPwzSayHbCzFJMdpj7Fqstkdvo1cqOR19zZSfhLYZ41AEbzCFgwJup/E9vWX reoc8SOJVx50pHczqiZlvF1INI9DeQepCD5+MJGySgdPNlD0Cmyr8YPmDDQB8Iye0ZsXvBZSoBl VfMaH3bnapB3lXcpsXVlF2fEPbnn3ZEIgftO2/7LAD8jMIJ6t7oHvdUtTW2CUH/dLqL9kr4LmML xKJ7EELJxvMvc1Zua61qVQzEo0cJLE5k9meGL9MKVarTbvXA8GomAzsYDM0anW0X2jJfUwTjouE U1gSEueGHod/I0knAP4HzCjFCFuyUTL6w15gYGAOCn+qB2JXzIssm79V318+Guyfh7AJWz4JjRa C4i9FwqvSNtP3H93lJaYh9BaTWNQ== X-Google-Smtp-Source: AGHT+IEFoaufhtQhW9IvDY1RlPlNMuzHF+hZt/2aoSTSKZxkU4XhEbVtz7dv7vqUjHSWeE+D5TBt/w== X-Received: by 2002:a05:7022:408:b0:119:e56b:98a7 with SMTP id a92af1059eb24-11e0326a1damr3443282c88.14.1765110115829; Sun, 07 Dec 2025 04:21:55 -0800 (PST) Received: from localhost.localdomain ([104.128.72.41]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-11df76e2f3csm38598822c88.5.2025.12.07.04.21.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Dec 2025 04:21:55 -0800 (PST) From: zhangshida X-Google-Original-From: zhangshida To: Johannes.Thumshirn@wdc.com, hch@infradead.org, agruenba@redhat.com, ming.lei@redhat.com, hsiangkao@linux.alibaba.com, csander@purestorage.com, colyli@fnnas.com Cc: linux-block@vger.kernel.org, linux-bcache@vger.kernel.org, linux-kernel@vger.kernel.org, zhangshida@kylinos.cn, starzhangzsd@gmail.com, Christoph Hellwig Subject: [PATCH v6 2/3] block: prohibit calls to bio_chain_endio Date: Sun, 7 Dec 2025 20:21:25 +0800 Message-Id: <20251207122126.3518192-3-zhangshida@kylinos.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20251207122126.3518192-1-zhangshida@kylinos.cn> References: <20251207122126.3518192-1-zhangshida@kylinos.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Shida Zhang Now that all potential callers of bio_chain_endio have been eliminated, completely prohibit any future calls to this function. Suggested-by: Ming Lei Suggested-by: Andreas Gruenbacher Suggested-by: Christoph Hellwig Reviewed-by: Christoph Hellwig Signed-off-by: Shida Zhang --- block/bio.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/block/bio.c b/block/bio.c index b3a79285c27..d236ca35271 100644 --- a/block/bio.c +++ b/block/bio.c @@ -320,9 +320,13 @@ static struct bio *__bio_chain_endio(struct bio *bio) return parent; } =20 +/* + * This function should only be used as a flag and must never be called. + * If execution reaches here, it indicates a serious programming error. + */ static void bio_chain_endio(struct bio *bio) { - bio_endio(__bio_chain_endio(bio)); + BUG(); } =20 /** --=20 2.34.1