aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2004-02-02 13:08:03 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2004-02-02 13:08:03 +0000
commit3e5b686160f1de227f07b9506ba4306f3c600600 (patch)
tree8c01c35204727231ce1cf91f648cf163fc518efb /sys
parent42fd931ee95c2c8cedfe52df296fe0b07accd5c0 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/vm/swap_pager.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index 32fde4e7c8903..93e193c7e1564 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -2415,6 +2415,17 @@ swapgeom_strategy(struct buf *bp, struct swdevt *sp)
return;
}
bio = g_clone_bio(&bp->b_io);
+ if (bio == NULL) {
+ /*
+ * XXX: This is better than panicing, but not much better.
+ * XXX: Somehow this should be retried. A more generic
+ * XXX: implementation of ENOMEM in geom may be able to cope.
+ */
+ bp->b_error = ENOMEM;
+ bp->b_ioflags |= BIO_ERROR;
+ bufdone(bp);
+ return;
+ }
bio->bio_caller2 = bp;
bio->bio_offset = (bp->b_blkno - sp->sw_first) * PAGE_SIZE;
bio->bio_length = bp->b_bcount;