From: sashiko-bot@kernel.org
To: "Song Chen" <chensong_2000@126.com>
Cc: "Vasily Gorbik" <gor@linux.ibm.com>,
linux-s390@vger.kernel.org,
"Alexander Gordeev" <agordeev@linux.ibm.com>,
"Heiko Carstens" <hca@linux.ibm.com>
Subject: Re: [RFC PATCH v2 2/3] btrfs: Allow error injection on btrfs_data_csum_ok
Date: Fri, 24 Jul 2026 02:21:50 +0000 [thread overview]
Message-ID: <20260724022150.D2D811F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260724021229.47302-3-chensong_2000@126.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The error injection completely bypasses the error reporting and notification logic it is intended to test.
--
--- Patch [2]: [RFC PATCH v2 2/3] btrfs: Allow error injection on btrfs_data_csum_ok ---
commit 1a83f56a9eedee07c1baca182513e1a6c13386dd
Author: Song Chen <chensong_2000@126.com>
btrfs: Allow error injection on btrfs_data_csum_ok
This patch marks btrfs_data_csum_ok with ALLOW_ERROR_INJECTION to allow the
fail_function infrastructure to simulate checksum mismatches. The intent is
to validate error detection and reporting paths in a controlled environment.
> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
> --- a/fs/btrfs/inode.c
> +++ b/fs/btrfs/inode.c
[ ... ]
> @@ -3397,6 +3397,7 @@ bool btrfs_data_csum_ok(struct btrfs_bio *bbio, struct btrfs_device *dev,
> memzero_page(phys_to_page(paddrs[i]), offset_in_page(paddrs[i]), step);
> return false;
> }
> +ALLOW_ERROR_INJECTION(btrfs_data_csum_ok, FALSE);
[Severity: Medium]
Does this bypass the error reporting logic it is intended to test?
The commit message states: "Testing the error handling path that responds
to such corruption, including any warning output and uspace notification..."
However, when fail_function overrides a function marked with
ALLOW_ERROR_INJECTION, it forces an immediate return without executing any
of the function body.
This means the actual error reporting section inside btrfs_data_csum_ok()
is entirely skipped:
fs/btrfs/inode.c:btrfs_data_csum_ok() {
[ ... ]
zeroit:
btrfs_print_data_csum_error(inode, file_offset, csum, csum_expected,
bbio->mirror_num);
if (dev)
btrfs_dev_stat_inc_and_print(dev, BTRFS_DEV_STAT_CORRUPTION_ERRS);
[ ... ]
}
Since the injected error causes the function to return false before this code
is reached, won't this skip the exact warning output and device stat
increments the patch is trying to validate?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260724021229.47302-1-chensong_2000@126.com?part=2
next prev parent reply other threads:[~2026-07-24 2:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-24 2:12 [RFC PATCH v2 0/3] btrfs: add error injection support for checksum verification Song Chen
2026-07-24 2:12 ` Song Chen
2026-07-24 2:12 ` [RFC PATCH v2 1/3] error-injection: Introduce EI_ETYPE_FALSE for fail_function Song Chen
2026-07-24 2:12 ` Song Chen
2026-07-24 2:20 ` sashiko-bot
2026-07-24 2:12 ` [RFC PATCH v2 2/3] btrfs: Allow error injection on btrfs_data_csum_ok Song Chen
2026-07-24 2:12 ` Song Chen
2026-07-24 2:21 ` sashiko-bot [this message]
2026-07-24 2:12 ` [RFC PATCH v2 3/3] error-injection: Introduce parent in fei_attr Song Chen
2026-07-24 2:12 ` Song Chen
2026-07-24 2:25 ` sashiko-bot
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=20260724022150.D2D811F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=agordeev@linux.ibm.com \
--cc=chensong_2000@126.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=linux-s390@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.