Date: Wed, 3 Jul 2013 14:58:12 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252569 - head/sys/cam/ctl Message-ID: <201307031458.r63EwC7g004029@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Wed Jul 3 14:58:11 2013 New Revision: 252569 URL: http://svnweb.freebsd.org/changeset/base/252569 Log: Fix NULL-deference kernel panic on attempt of destroying non-existing ramdisk-backed CTL LUN. Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_ramdisk.c Wed Jul 3 13:57:36 2013 (r252568) +++ head/sys/cam/ctl/ctl_backend_ramdisk.c Wed Jul 3 14:58:11 2013 (r252569) @@ -441,6 +441,9 @@ ctl_backend_ramdisk_rm(struct ctl_be_ram snprintf(req->error_str, sizeof(req->error_str), "%s: error %d returned from ctl_invalidate_lun() for " "LUN %d", __func__, retval, params->lun_id); + mtx_lock(&softc->lock); + be_lun->flags &= ~CTL_BE_RAMDISK_LUN_WAITING; + mtx_unlock(&softc->lock); goto bailout_error; } @@ -475,14 +478,6 @@ ctl_backend_ramdisk_rm(struct ctl_be_ram return (retval); bailout_error: - - /* - * Don't leave the waiting flag set. - */ - mtx_lock(&softc->lock); - be_lun->flags &= ~CTL_BE_RAMDISK_LUN_WAITING; - mtx_unlock(&softc->lock); - req->status = CTL_LUN_ERROR; return (0);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307031458.r63EwC7g004029>