FreeBSD Bugzilla – Attachment 185874 Details for
Bug 162036
[geom] Fatal trap 12: page fault while in kernel mode -- Stopped at atomic_subtract_int+0x4
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Let g_eli deal with lost devices without crashing
Let-g_eli-deal-with-lost-devices-without-crashing.diff (text/plain), 2.44 KB, created by
Fabian Keil
on 2017-08-29 12:52:22 UTC
(
hide
)
Description:
Let g_eli deal with lost devices without crashing
Filename:
MIME Type:
Creator:
Fabian Keil
Created:
2017-08-29 12:52:22 UTC
Size:
2.44 KB
patch
obsolete
>From b17a29638db0d92e75f4a609842b7fb7f370f40e Mon Sep 17 00:00:00 2001 >From: Fabian Keil <fk@fabiankeil.de> >Date: Tue, 19 Feb 2013 14:42:00 +0100 >Subject: [PATCH 1/2] Let g_eli_*read_done() deal with lost devices without > causing panics > >PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=162036 >PR submission date: 2011-10-26 > >Obtained from: ElectroBSD >--- > sys/geom/eli/g_eli.c | 3 ++- > sys/geom/eli/g_eli_privacy.c | 6 ++++-- > 2 files changed, 6 insertions(+), 3 deletions(-) > >diff --git a/sys/geom/eli/g_eli.c b/sys/geom/eli/g_eli.c >index 6d734aece183..bd198c043c2c 100644 >--- a/sys/geom/eli/g_eli.c >+++ b/sys/geom/eli/g_eli.c >@@ -214,7 +214,8 @@ g_eli_read_done(struct bio *bp) > pbp->bio_driver2 = NULL; > } > g_io_deliver(pbp, pbp->bio_error); >- atomic_subtract_int(&sc->sc_inflight, 1); >+ if (sc != NULL) >+ atomic_subtract_int(&sc->sc_inflight, 1); > return; > } > mtx_lock(&sc->sc_queue_mtx); >diff --git a/sys/geom/eli/g_eli_privacy.c b/sys/geom/eli/g_eli_privacy.c >index d636e1fb0ba0..6ed584684092 100644 >--- a/sys/geom/eli/g_eli_privacy.c >+++ b/sys/geom/eli/g_eli_privacy.c >@@ -87,7 +87,8 @@ g_eli_crypto_read_done(struct cryptop *crp) > bp->bio_error = crp->crp_etype; > } > sc = bp->bio_to->geom->softc; >- g_eli_key_drop(sc, crp->crp_desc->crd_key); >+ if (sc != NULL) >+ g_eli_key_drop(sc, crp->crp_desc->crd_key); > /* > * Do we have all sectors already? > */ >@@ -104,7 +105,8 @@ g_eli_crypto_read_done(struct cryptop *crp) > * Read is finished, send it up. > */ > g_io_deliver(bp, bp->bio_error); >- atomic_subtract_int(&sc->sc_inflight, 1); >+ if (sc != NULL) >+ atomic_subtract_int(&sc->sc_inflight, 1); > return (0); > } > >-- >2.14.1 > >From 218db44b94ad30f5a1235133195b718dd142c65e Mon Sep 17 00:00:00 2001 >From: Fabian Keil <fk@fabiankeil.de> >Date: Fri, 22 Feb 2013 11:09:20 +0100 >Subject: [PATCH 2/2] Let g_eli_write_done() verify that sc isn't NULL > >The code looks similar enough to g_eli_read_done() to be affected >by kern/162036 as well. > >Obtained from: ElectroBSD >--- > sys/geom/eli/g_eli.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > >diff --git a/sys/geom/eli/g_eli.c b/sys/geom/eli/g_eli.c >index bd198c043c2c..920ed0cc118e 100644 >--- a/sys/geom/eli/g_eli.c >+++ b/sys/geom/eli/g_eli.c >@@ -260,7 +260,8 @@ g_eli_write_done(struct bio *bp) > */ > sc = pbp->bio_to->geom->softc; > g_io_deliver(pbp, pbp->bio_error); >- atomic_subtract_int(&sc->sc_inflight, 1); >+ if (sc != NULL) >+ atomic_subtract_int(&sc->sc_inflight, 1); > } > > /* >-- >2.14.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 162036
: 185874