From: Andreas Gruenbacher <agruenba@redhat.com>
To: Carlos Maiolino <cem@kernel.org>
Cc: Andreas Gruenbacher <agruenba@redhat.com>,
linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] xfs: don't clobber bi_status in xfs_zone_alloc_and_submit
Date: Wed, 4 Mar 2026 19:59:20 +0100 [thread overview]
Message-ID: <20260304185923.291592-1-agruenba@redhat.com> (raw)
Function xfs_zone_alloc_and_submit() sets bio->bi_status and then it
calls bio_io_error() which overwrites that value again. Fix that by
completing the bio separately after setting bio->bi_status.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
---
fs/xfs/xfs_zone_alloc.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/fs/xfs/xfs_zone_alloc.c b/fs/xfs/xfs_zone_alloc.c
index e3d19b6dc64a..c3328b9dda37 100644
--- a/fs/xfs/xfs_zone_alloc.c
+++ b/fs/xfs/xfs_zone_alloc.c
@@ -862,7 +862,7 @@ xfs_zone_alloc_and_submit(
bool is_seq;
if (xfs_is_shutdown(mp))
- goto out_error;
+ goto out_io_error;
/*
* If we don't have a locally cached zone in this write context, see if
@@ -875,7 +875,7 @@ xfs_zone_alloc_and_submit(
select_zone:
*oz = xfs_select_zone(mp, write_hint, pack_tight);
if (!*oz)
- goto out_error;
+ goto out_io_error;
xfs_set_cached_zone(ip, *oz);
}
@@ -902,7 +902,10 @@ xfs_zone_alloc_and_submit(
out_split_error:
ioend->io_bio.bi_status = errno_to_blk_status(PTR_ERR(split));
-out_error:
+ bio_endio(&ioend->io_bio);
+ return;
+
+out_io_error:
bio_io_error(&ioend->io_bio);
}
--
2.52.0
next reply other threads:[~2026-03-04 18:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-04 18:59 Andreas Gruenbacher [this message]
2026-03-04 19:53 ` Darrick J. Wong
2026-03-05 9:05 ` Carlos Maiolino
2026-03-05 9:47 ` Carlos Maiolino
2026-03-05 14:02 ` Christoph Hellwig
2026-03-05 16:20 ` Carlos Maiolino
2026-03-05 18:09 ` Andreas Gruenbacher
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=20260304185923.291592-1-agruenba@redhat.com \
--to=agruenba@redhat.com \
--cc=cem@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
/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®