svn commit: r335191 - stable/11/sys/kern
Mark Johnston
markj at FreeBSD.org
Fri Jun 15 08:59:26 UTC 2018
Author: markj
Date: Fri Jun 15 08:59:24 2018
New Revision: 335191
URL: https://svnweb.freebsd.org/changeset/base/335191
Log:
MFC r334506:
Avoid completing I/O when dumping core after a panic.
Modified:
stable/11/sys/kern/vfs_bio.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/kern/vfs_bio.c
==============================================================================
--- stable/11/sys/kern/vfs_bio.c Fri Jun 15 08:36:21 2018 (r335190)
+++ stable/11/sys/kern/vfs_bio.c Fri Jun 15 08:59:24 2018 (r335191)
@@ -3942,6 +3942,8 @@ allocbuf(struct buf *bp, int size)
extern int inflight_transient_maps;
+static struct bio_queue nondump_bios;
+
void
biodone(struct bio *bp)
{
@@ -3949,6 +3951,17 @@ biodone(struct bio *bp)
void (*done)(struct bio *);
vm_offset_t start, end;
+
+ /*
+ * Avoid completing I/O when dumping after a panic since that may
+ * result in a deadlock in the filesystem or pager code. Note that
+ * this doesn't affect dumps that were started manually since we aim
+ * to keep the system usable after it has been resumed.
+ */
+ if (__predict_false(dumping && SCHEDULER_STOPPED())) {
+ TAILQ_INSERT_HEAD(&nondump_bios, bp, bio_queue);
+ return;
+ }
if ((bp->bio_flags & BIO_TRANSIENT_MAPPING) != 0) {
bp->bio_flags &= ~BIO_TRANSIENT_MAPPING;
bp->bio_flags |= BIO_UNMAPPED;
More information about the svn-src-stable
mailing list