From: Shivang Upadhyay <shivangu@linux.ibm.com>
To: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>,
Ritesh Harjani <riteshh@linux.ibm.com>,
Shrikanth Hegde <sshegde@linux.ibm.com>,
Christophe Leroy <christophe.leroy@csgroup.eu>,
nandinih@linux.ibm.com, LKML <linux-kernel@vger.kernel.org>,
linuxppc-dev <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [BUG] selftests/powerpc/eeh: eeh-basic breaks the device hosting rootfs, ext4 goes read-only and the test harness crashes
Date: Thu, 26 Nov 2026 01:09:16 +0530 [thread overview]
Message-ID: <awc5ZMnS97T51Rpg@shivang.upadyay> (raw)
In-Reply-To: <9113e399-ddd0-405e-9abb-69a9785c726c@linux.ibm.com>
On Thu, Nov 12, 2026 at 11:36:36AM +0530, Venkat Rao Bagalkote wrote:
> Hello!!!
>
> IBM CI has hit a failure that takes down the test harness, While running the
> powerpc EEH selftest on a bare-metal POWER system.
>
> The selftest injects an error into the PCI device that hosts the root
> filesystem. The filesystem goes read-only and the run dies.
>
> [ 1112.079091] EEH: Frozen PHB#3-PE#1fd detected
> [ 1112.079905] aacraid 0003:01:00.0: aacraid: PCI error detected 2
> [ 1112.140830] I/O error, dev sdb, sector 3906906472 op 0x1:(WRITE) ...
> [ 1112.140957] Aborting journal on device sdb2-8.
> [ 1112.140977] EXT4-fs error (device sdb2) in ext4_dirty_inode:7656: IO
> failure
> [ 1112.176664] EXT4-fs error (device sdb2): ext4_journal_check_start:98: ...
> Detected aborted journal
> [ 1187.736385] aacraid 0003:01:00.0: aacraid: PCI error - slot reset
> [ 1217.244306] EXT4-fs (sdb2): Remounting filesystem read-only
> [ 1220.583495] aacraid 0003:01:00.0: aacraid: PCI error - resume
>
> We need to make appropriate changes to selftest, so that it skips the
> adapter, if rootfs is hosted on it.
>
>
> SetUp:
>
> System: IBM 9006-22C (POWER9), PowerNV, bare metal
> Firmware: skiboot-v6.8-45-g8246de863
> Kernel: 7.4.0-rc2+, upstream master at 067c5c24cef2 ("Merge tag
> 'page_alloc-for-7.4-rc2'", 2026-11-10)
>
>
> Issue1: Selftest should skip the adapter that host the rootfs
>
> eeh_can_break() already skips ahci, for similar reason, but has no check for
> a device that backs /. A friendly LLM has suggested
>
> below change, which I tested and it works.
>
> 0003:01:00.0, Skipped: hosts the root filesystem
>
> Other adapters are tested as before and the run completes
>
> diff --git a/tools/testing/selftests/powerpc/eeh/eeh-functions.sh
> b/tools/testing/selftests/powerpc/eeh/eeh-functions.sh
> index 70daa3925dcb..f9db1f9be05a 100644
> --- a/tools/testing/selftests/powerpc/eeh/eeh-functions.sh
> +++ b/tools/testing/selftests/powerpc/eeh/eeh-functions.sh
> @@ -62,6 +62,42 @@ eeh_test_prep() {
> echo 5000 > /sys/kernel/debug/powerpc/eeh_max_freezes
> }
>
> +# Print the resolved sysfs path of a block device followed by the paths of
> +# every device stacked underneath it (dm, md, etc).
> +eeh_blk_sysfs_paths() {
> + local sys="$1"
> + local s
> +
> + realpath "$sys"
> + for s in "$sys"/slaves/* ; do
> + if [ -e "$s" ] ; then
> + eeh_blk_sysfs_paths "$s"
> + fi
> + done
> +}
> +
> +# Succeeds if the root filesystem lives on a disk behind any function of
> the
> +# slot containing the given PCI device.
> +eeh_hosts_rootfs() {
> + local slot="${1%.*}"
> + local majmin src sys
> +
> + # Use the last "/" entry so an initramfs rootfs entry is ignored.
> + majmin="$(awk '$5 == "/" { mm = $3 } END { print mm }'
> /proc/self/mountinfo)"
> + src="$(awk '$5 == "/" { for (i = 6; i < NF; i++) if ($i == "-") s = $(i
> + 2) } END { print s }' /proc/self/mountinfo)"
> +
> + if [ -e "/sys/dev/block/$majmin" ] ; then
> + sys="/sys/dev/block/$majmin"
> + elif [ -b "$src" ] ; then
> + # e.g. btrfs reports an anonymous major:minor
> + sys="/sys/class/block/$(basename "$(realpath "$src")")"
> + else
> + return 1
> + fi
> +
> + eeh_blk_sysfs_paths "$sys" 2>/dev/null | grep -q "/${slot}\.[0-7]/"
> +}
> +
> eeh_can_break() {
> # skip bridges since we can't recover them (yet...)
> if [ -e "/sys/bus/pci/devices/$dev/pci_bus" ] ; then
> @@ -78,6 +114,14 @@ eeh_can_break() {
> return 1;
> fi
>
> + # Breaking the device that hosts the root filesystem makes I/O fail
> + # during recovery, which can abort the journal and leave / read-only
> + # (and kill the test harness). Leave it alone.
> + if eeh_hosts_rootfs "$1" ; then
> + log "$1, Skipped: hosts the root filesystem"
Well as per my understanding, Testing the device where rootfs is hosted on
seems like a valid usecase for selftest. Maybe we should keep that ability.
Atleast keep it as opt-in.
The above freeze happened because write failed. Can we perhaps create our
own freeze window so that none of
filesystem write fail.
I am suggesting to test the following (suggested by Friendly LLM :),
sync
fsfreeze -f / # flush dirty data and the journal, then block new writes
# ... inject the error, wait for EEH recovery ...
fsfreeze -u / # thaw
Thanks
~Shivang
prev parent reply other threads:[~2026-11-25 19:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-12 6:06 Venkat Rao Bagalkote
2026-11-24 11:31 ` Narayana Murty N
2026-11-25 19:39 ` Shivang Upadhyay [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=awc5ZMnS97T51Rpg@shivang.upadyay \
--to=shivangu@linux.ibm.com \
--cc=christophe.leroy@csgroup.eu \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=nandinih@linux.ibm.com \
--cc=riteshh@linux.ibm.com \
--cc=sshegde@linux.ibm.com \
--cc=venkat88@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®