From: Christoph Hellwig <hch@infradead.org>
To: Chandan Babu R <chandanbabu@kernel.org>
Cc: kbusch@kernel.org, linux-block@vger.kernel.org,
linux-xfs@vger.kernel.org
Subject: Re: [BUG REPORT] General protection fault while discarding extents on XFS on next-20240305
Date: Wed, 6 Mar 2024 04:35:09 -0800 [thread overview]
Message-ID: <Zehi_bLuwz9PcbN9@infradead.org> (raw)
In-Reply-To: <87y1avlsmw.fsf@debian-BULLSEYE-live-builder-AMD64>
On Wed, Mar 06, 2024 at 12:49:29PM +0530, Chandan Babu R wrote:
> The above *probably* occured because __blkdev_issue_discard() noticed a pending
> signal, processed the bio, freed the bio and returned a non-NULL bio pointer
> to the caller (i.e. xfs_discard_extents()).
>
> xfs_discard_extents() then tries to process the freed bio once again.
Yes, __blkdev_issue_discard really needs to clear *biop to NULL for
this case, i.e.:
diff --git a/block/blk-lib.c b/block/blk-lib.c
index dc8e35d0a51d6d..26850d4895cdaf 100644
--- a/block/blk-lib.c
+++ b/block/blk-lib.c
@@ -99,6 +99,7 @@ int __blkdev_issue_discard(struct block_device *bdev, sector_t sector,
cond_resched();
if (fatal_signal_pending(current)) {
await_bio_chain(bio);
+ *biop = NULL;
return -EINTR;
}
}
next prev parent reply other threads:[~2024-03-06 12:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-06 7:19 [BUG REPORT] General protection fault while discarding extents on XFS on next-20240305 Chandan Babu R
2024-03-06 12:35 ` Christoph Hellwig [this message]
2024-03-06 14:36 ` Keith Busch
2024-03-06 14:40 ` Keith Busch
2024-03-06 14:45 ` Christoph Hellwig
2024-03-06 15:18 ` Christoph Hellwig
2024-03-06 20:51 ` Dave Chinner
2024-03-06 22:16 ` Christoph Hellwig
2024-03-07 9:21 ` Nilay Shroff
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=Zehi_bLuwz9PcbN9@infradead.org \
--to=hch@infradead.org \
--cc=chandanbabu@kernel.org \
--cc=kbusch@kernel.org \
--cc=linux-block@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 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.