diff options
author | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2009-01-11 13:51:04 +0000 |
---|---|---|
committer | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2009-01-11 13:51:04 +0000 |
commit | 38153e80f7cdbeac2c729431e663cbe28b951dca (patch) | |
tree | 6cb3700dd41f880fa5751ae0a60e05080d308406 /sys/geom/geom_vfs.c | |
parent | 56035520b7ba1965cda2023f9a675d4ec31ab245 (diff) | |
download | src-38153e80f7cdbeac2c729431e663cbe28b951dca.tar.gz src-38153e80f7cdbeac2c729431e663cbe28b951dca.zip |
Prevent a panic that happens on SMP machines when removing a disk with
many writes queued up.
Reviewed by: phk, scottl
Approved by: rwatson (mentor)
Sponsored by: FreeBSD Foundation
Notes
Notes:
svn path=/head/; revision=187053
Diffstat (limited to 'sys/geom/geom_vfs.c')
-rw-r--r-- | sys/geom/geom_vfs.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/geom/geom_vfs.c b/sys/geom/geom_vfs.c index 86c909df8c63..1fce07a11df1 100644 --- a/sys/geom/geom_vfs.c +++ b/sys/geom/geom_vfs.c @@ -71,6 +71,16 @@ g_vfs_done(struct bio *bip) struct buf *bp; int vfslocked; + /* + * Provider ('bio_to') could have withered away sometime + * between incrementing the 'nend' in g_io_deliver() and now, + * making 'bio_to' a dangling pointer. We cannot do that + * in g_wither_geom(), as it would require going over + * the 'g_bio_run_up' list, resetting the pointer. + */ + if (bip->bio_from->provider == NULL) + bip->bio_to = NULL; + if (bip->bio_error) { printf("g_vfs_done():"); g_print_bio(bip); @@ -136,7 +146,7 @@ g_vfs_orphan(struct g_consumer *cp) g_detach(cp); /* - * Do not destroy the geom. Filesystem will do this during unmount. + * Do not destroy the geom. Filesystem will do that during unmount. */ } |