]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfsprogs-dev.git/commitdiff
xfs_scrub: don't flatten error numbers in read_verify_schedule_now
authorDarrick J. Wong <djwong@kernel.org>
Mon, 8 Jun 2026 15:41:52 +0000 (08:41 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 30 Jun 2026 00:57:06 +0000 (17:57 -0700)
Codex complains about using a bool variable to convey the results of
workqueue_add (which returns int) to rvp->runtime_error (which is
declared int).  As originally written in commit 2000470d5376e4, this
type inconsistency was a benign thinko because code branching decisions
were made based on whether or not workqueue_add returned nonzero but the
error itself was not preserved.  However, commit 5c657f1e5a9329 started
preserving the errors but didn't change the @ret declaration, so that's
where the bug was introduced.

Cc: <linux-xfs@vger.kernel.org> # v5.3.0
Fixes: 5c657f1e5a9329 ("xfs_scrub: fix handling of read-verify pool runtime errors")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
scrub/read_verify.c

index efdf6d544858b8343649349b2f9f0c2ce41117fa..311ea1c29008f7f6391468a7d4477b0f6dd4644d 100644 (file)
@@ -471,7 +471,7 @@ read_verify_schedule_now(
 {
        struct read_verify_pool         *rvp = rs->rvp;
        struct read_verify              *tmp;
-       bool                            ret;
+       int                             ret;
 
        if (!rvp)
                return 0;