From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796350567; b=cXVYSc+zhmDHOE5qSdhQOszYOMzHcC0fjLb8etKflbPdyGuK1oohkup2LxNNyhlt2Uos tsBUnnGAZf37ZEQupcnqYrL+c+eYMUDjTdnxUlfs7SWFlOFJJ5tCZlpXkaYbiyijz7GSx 16eseNFai8GIQHV9VTT7DzaF4FlEPqBWTYZhgK79qzL4E+8284i2LnqhhZ7P5kCUggj2M Gq02Pfxp3Ecf690FUVJQICZnZRZDBRWaqkeZQ8DeCaDgsa33QCoFwZYHgc1e+zd38+Lel RuTVOVh5Mkh6KEM1CuDjSQ0Raw76Xt4v3QuETNl3h/pMP24o2Oq4ycZ8qKhErJWe6+w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796350567; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=3oCLID7zaRWjiKiPCll6nmSb4VXJoE/EDTAHUaxzR2I=; b=fC4ynqiOFNb5JVED0KgU1s2J9kK2VxKmi4R5go0QneKOHM5kCjLzujqfAR3CnUOSE42P gaFUitcf870uezbP7JvGtv0mWxdHCIBzPt2zwBFPX+cMa/7UYlQu/YA0iDQkfvpQN9CsX 3OJZBoJ7wp6ogm1wY/y5/u8YO/dypR6WRxxYM5KW746bcJxdrErcikMi3qE97iUGlwi3P Vd6YIg2pZRM7nL6/C+6qCKPFlSUYZzbOfhMJ+gaFcEsqNbBqovakn0OZFIaoBk/CJ+boi PfTpoijl7966+dJVs0B+0IMxGFSE0PA7xPX1cy/SxxZih1M9wRRbGkdlZzkNFJ3JIBQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QYyffnyC; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E1C9606A332 for ; Fri, 4 Dec 2026 02:16:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QYyffnyC Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8EB701F00936; Fri, 4 Dec 2026 02:16:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796350566; bh=3oCLID7zaRWjiKiPCll6nmSb4VXJoE/EDTAHUaxzR2I=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=QYyffnyC7PbduBT6B/xCpgmzZ2BT5QOb6UDMpLtFt+56MGPjVbzIPTevlZ9K7U+sl OrAovEy97LnJ5Fa2jxcXugyM9TKFMBWwbW7EbEDsDAYK1So2QxiL9UDmzklaCeM1e8 SUackfRdbmHp1PsgNexytu7SzDixfJIsLLpuZHHNwQv9PhHhJpYhsh7SU0iFX3xZFV MRYhxIIUUxryiIV33u2kllhA1Ggn2gw1eN25IK3ULpM0PpEW9lVNCit8RqOC8S+IP1 2P3AeqOXwzg/72+JgXmpfCb2lFOGYWpyyafC74CVOuafzYQsA8+vAQcAKavrqb7tRP m1Wykbvp3REKQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] scsi: core: include scsi_lib KUnit tests in modular builds Reply-To: sashiko-reviews@lists.linux.dev To: "Pengpeng Hou" Cc: linux-scsi@vger.kernel.org In-Reply-To: <179634982482.74470.2785930501744791630@163.com> References: <179634982482.74470.2785930501744791630@163.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 02:16:06 +0000 X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] scsi: embedding scsi_lib_test.c couples scsi_mod.ko to kunit.ko and taints -- commit 62bce85f8688e7b2497edd8565cef82538ee735c Author: Pengpeng Hou scsi: core: include scsi_lib KUnit tests in modular builds This commit changes the guard around including scsi_lib_test.c in drivers/scsi/scsi_lib.c from #ifdef to IS_REACHABLE() so the KUnit tests are included when both SCSI and SCSI_LIB_KUNIT_TEST are built as modules. > diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c > index ab39514cc0c6b..9489188038319 100644 > --- a/drivers/scsi/scsi_lib.c > +++ b/drivers/scsi/scsi_lib.c > @@ -3611,6 +3611,6 @@ void scsi_set_sense(struct scsi_cmnd *scmd, int des= c, u8 key, u16 code) > } > EXPORT_SYMBOL_GPL(scsi_set_sense); > =20 > -#ifdef CONFIG_SCSI_LIB_KUNIT_TEST > +#if IS_REACHABLE(CONFIG_SCSI_LIB_KUNIT_TEST) > #include "scsi_lib_test.c" > #endif [Severity: Medium] Does embedding scsi_lib_test.c into scsi_mod.ko couple core SCSI to kunit.ko? With CONFIG_SCSI=3Dm and CONFIG_KUNIT_ALL_TESTS=3Dm, CONFIG_SCSI_LIB_KUNIT_= TEST defaults to m, compiling scsi_lib_test.c into scsi_mod.ko. Its KUNIT_EXPECT_EQ() calls reference __kunit_do_failed_assertion from kunit.ko, preventing scsi_mod.ko from loading if an initramfs omits kunit.ko. Loading scsi_mod.ko also triggers kunit_module_notify() to run scsi_lib_test_suite during normal boot, tainting the kernel with TAINT_TEST and keeping the suite's debugfs entries until scsi_mod.ko is unloaded. The tests also cannot be loaded or re-run independently of scsi_mod.ko. Marking scsi_check_passthrough() with VISIBLE_IF_KUNIT and EXPORT_SYMBOL_IF_KUNIT() and building scsi_lib_test.o as a separate module via obj-$(CONFIG_SCSI_LIB_KUNIT_TEST) in drivers/scsi/Makefile would avoid both issues and also support CONFIG_SCSI=3Dy. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/179634982482.74470.= 2785930501744791630@163.com?part=3D1