From nobody Mon Dec 1 23:05:29 2025 Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) (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 A71002773CC for ; Sat, 29 Nov 2025 09:01:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764406907; cv=none; b=C9LD9ofISEs+0uMVUSsLbEWAvx8VRjHOov1PtEPHVwlH5XJUMgCFFtgdXH4T407oteLksdxvOdnFxtVXH5FWUYe/DIeinXjH0Yh1OLFCFHcCo0sV0RIF+VnHwlJgzM8JTO1AkAORyGvVPYj0YGnE21+X5gNkrbgLIB/zlJIhk3Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764406907; c=relaxed/simple; bh=jExYI2jaoXiycbQo0Q43ubPRMYOXkZVZRm5nOe4POx4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=fOhfgU8rKMSNITWGp7ETCvyF/pT4pYDWX1iqkU16LmIkrhIrdVUj2VbL+HFx+uX70r4ogWH//S2eTNyJWU1fIo3fEi2FCa3j+vaPXUj/yyMyVe2/ZF9fISyr7TJCe57N+GdeYNlBiFmrEGQm5SCKj9YRTxzcllrqzVM+z8lQVvM= 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=TvRXDnxg; arc=none smtp.client-ip=209.85.216.44 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="TvRXDnxg" Received: by mail-pj1-f44.google.com with SMTP id 98e67ed59e1d1-3436a97f092so3171656a91.3 for ; Sat, 29 Nov 2025 01:01:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764406905; x=1765011705; 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=06c4CDfEOBNFQOCEh49v+FDqCuxNhXoe5zY9J+9QjgY=; b=TvRXDnxgYMTshHKZhCkNuQ8FV3gg1bdYMVAug+4q2m7RRIJFZP3bof47t8xMRAwQlt sfyTFiIZZuuha8Hz8Ne2dkWvL2hUjjM63zPUh8CuJYHc3B/Uteja/oe46MPZWoA3yZzB 3LMMCQ/5opwPbW7tW1owwPc0eBfi+cxKVM2bujQFczwpyMq2T6/EULqBvibxevSUXKKz J9z7FyBAcYtD0q2gOfX6TLpbPu8zbiHkT5Pv7rnd0vqwnhda/51Qx5yEy9bse7VGr3ze ydw9cmZkHB2ELAbaa/CMzlg+Q7Q7MTh075eQ77AxuBGoXv01GceI/QVGQ4zUXSCDHSyT AhUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764406905; x=1765011705; 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=06c4CDfEOBNFQOCEh49v+FDqCuxNhXoe5zY9J+9QjgY=; b=IP+uWcFQHHUU3dwnAueYjCPQDABdz3R+JHVZ6n9TjmlZVOLa9UilcJUKyQ8MqTBVDp kn35bJPOqkojOr78L5dzrztgMNIJcFgHWleyEzc1rprV9gvzjX0DViGeC6p7A8pKyLJN PsVGMla0rViWnicndrum5ZAKTwtxI7unGuSn0IPOTB/cMtbdPH8BUYlAoQr5eusqaBtf iW+oxPhJ0I5pRzq+loNOzhmI1C6wgxIxLwUVt+lh+wgIy0v9e4zTBgkCVgpUiFQm2pth qGLeEsUdEVCI38ZTBOV7e8iViuB0zyzGQ/MTc3umc3U36lhidhLuqUrDfdqxR+miKtoA S4eQ== X-Forwarded-Encrypted: i=1; AJvYcCXaTteW3bg4/9P4Xe3WPOZ/xWWh/7iX3gxjJMa4p9MrIzW6hjLEjZwhF2OsaQX8kpG+4F00DAYFgl8Mulg=@vger.kernel.org X-Gm-Message-State: AOJu0Ywa7QaBa23rW5lV0NIRseSp5jjszvoxlcpa9elJAaBvup34vvGY gWKJcX7ZanUz6KkINw76FHW0fInB5E4d0yZqNGJmIAiUJols8XrqOiEn X-Gm-Gg: ASbGncuP7wsFSpreSYqFRZ91ThV/NtnYlYsQQdZ49iLlDlJE3HgcQqy34oqIj8qJa8X ypYKQcjcymOfsM1t70Q6qnzZxTx6Ay84BVzy7ncehbWmcmXDpLxwm8IE3UCmifY16StZphS859P 695d5dxNshCjZYLoQwczmqpu5OQ8H7QJLvfh445tKOPTkTzLAEoYmcT02xi3fuWyivjmbw2Jv+m ea+w/E7Mr6HBDBetYplsg/p3NivHuc5lOex0KGZljjuDz0OwpuzhcUZcvLXT/+Dp/skZ6XwbNLg qKGz9Jmxc0CIC4Zhs2nBGByXBmqCz5ueTKQESdC3MGHBBviNemnDpef5TgBiwsXINPPUZe205iN SrgZOzIbI9JDTJoP7zPy7wBko6f1yuYW9b9T8n/1mctMZOC+ahQ93rX4lOGkcFs5awsQn7KOwHS 7eYlfL9qI04Y35xoKm3rlB4cBp1Q== X-Google-Smtp-Source: AGHT+IEFFhMF6u7tNXXwfE6dPq1pkaM+HsOKRV95Dom9e3MOSpru2Keq8NWtpHMva0MzTN1ZATf4vQ== X-Received: by 2002:a05:7022:62aa:b0:11b:c1ab:bdd4 with SMTP id a92af1059eb24-11cbba4ab67mr12173129c88.38.1764406904816; Sat, 29 Nov 2025 01:01:44 -0800 (PST) Received: from localhost.localdomain ([104.128.72.44]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-11dcae73bedsm28114394c88.0.2025.11.29.01.01.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Nov 2025 01:01:44 -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 Cc: linux-block@vger.kernel.org, linux-bcache@vger.kernel.org, nvdimm@lists.linux.dev, virtualization@lists.linux.dev, ntfs3@lists.linux.dev, linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org, zhangshida@kylinos.cn, starzhangzsd@gmail.com Subject: [PATCH v3 2/9] block: prohibit calls to bio_chain_endio Date: Sat, 29 Nov 2025 17:01:15 +0800 Message-Id: <20251129090122.2457896-3-zhangshida@kylinos.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20251129090122.2457896-1-zhangshida@kylinos.cn> References: <20251129090122.2457896-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 Signed-off-by: Shida Zhang Reviewed-by: Christoph Hellwig --- block/bio.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/block/bio.c b/block/bio.c index b3a79285c27..1b5e4577f4c 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_ON(1); } =20 /** --=20 2.34.1