FreeBSD Bugzilla – Attachment 231358 Details for
Bug 255131
kernel panic using zfs on shsec
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch
diff (text/plain), 2.31 KB, created by
Mark Johnston
on 2022-01-26 16:00:11 UTC
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Mark Johnston
Created:
2022-01-26 16:00:11 UTC
Size:
2.31 KB
patch
obsolete
>commit 9e9962bc6c800cfafd0b04199a19793e59ab69b2 >Author: Mark Johnston <markj@FreeBSD.org> >Date: Wed Jan 26 10:58:26 2022 -0500 > > shsec: Handle BIO_FLUSH commands properly > >diff --git a/sys/geom/geom_io.c b/sys/geom/geom_io.c >index 6ec90741a7e2..a5cb8c7279e4 100644 >--- a/sys/geom/geom_io.c >+++ b/sys/geom/geom_io.c >@@ -521,7 +521,7 @@ g_io_request(struct bio *bp, struct g_consumer *cp) > KASSERT(bp->bio_data != NULL, > ("NULL bp->data in g_io_request(cmd=%hu)", bp->bio_cmd)); > } >- if (cmd == BIO_DELETE || cmd == BIO_FLUSH) { >+ if (cmd == BIO_DELETE || cmd == BIO_FLUSH || cmd == BIO_SPEEDUP) { > KASSERT(bp->bio_data == NULL, > ("non-NULL bp->data in g_io_request(cmd=%hu)", > bp->bio_cmd)); >diff --git a/sys/geom/shsec/g_shsec.c b/sys/geom/shsec/g_shsec.c >index 65bfbc6681dd..50a2c5835b7f 100644 >--- a/sys/geom/shsec/g_shsec.c >+++ b/sys/geom/shsec/g_shsec.c >@@ -270,8 +270,10 @@ g_shsec_done(struct bio *bp) > (ssize_t)pbp->bio_length); > } > } >- explicit_bzero(bp->bio_data, bp->bio_length); >- uma_zfree(g_shsec_zone, bp->bio_data); >+ if (bp->bio_data != NULL) { >+ explicit_bzero(bp->bio_data, bp->bio_length); >+ uma_zfree(g_shsec_zone, bp->bio_data); >+ } > g_destroy_bio(bp); > pbp->bio_inbed++; > if (pbp->bio_children == pbp->bio_inbed) { >@@ -349,22 +351,24 @@ g_shsec_start(struct bio *bp) > * Fill in the component buf structure. > */ > cbp->bio_done = g_shsec_done; >- cbp->bio_data = uma_zalloc(g_shsec_zone, M_NOWAIT); >- if (cbp->bio_data == NULL) { >- g_shsec_alloc_failed++; >- error = ENOMEM; >- goto failure; >- } >- cbp->bio_caller2 = sc->sc_disks[no]; >- if (bp->bio_cmd == BIO_WRITE) { >- if (no == 0) { >- dst = (uint32_t *)cbp->bio_data; >- bcopy(bp->bio_data, dst, len); >- } else { >- g_shsec_xor2((uint32_t *)cbp->bio_data, dst, >- len); >+ if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { >+ cbp->bio_data = uma_zalloc(g_shsec_zone, M_NOWAIT); >+ if (cbp->bio_data == NULL) { >+ g_shsec_alloc_failed++; >+ error = ENOMEM; >+ goto failure; >+ } >+ if (bp->bio_cmd == BIO_WRITE) { >+ if (no == 0) { >+ dst = (uint32_t *)cbp->bio_data; >+ bcopy(bp->bio_data, dst, len); >+ } else { >+ g_shsec_xor2((uint32_t *)cbp->bio_data, >+ dst, len); >+ } > } > } >+ cbp->bio_caller2 = sc->sc_disks[no]; > } > /* > * Fire off all allocated requests!
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 255131
:
231357
| 231358