Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Feb 2017 18:03:17 +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: r313736 - head/sys/cam/ctl
Message-ID:  <201702141803.v1EI3HpB072539@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Tue Feb 14 18:03:17 2017
New Revision: 313736
URL: https://svnweb.freebsd.org/changeset/base/313736

Log:
  Fix panic on shutdown of ramdisk LU with zero capacity.
  
  MFC after:	1 week

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	Tue Feb 14 17:49:08 2017	(r313735)
+++ head/sys/cam/ctl/ctl_backend_ramdisk.c	Tue Feb 14 18:03:17 2017	(r313736)
@@ -1120,8 +1120,10 @@ ctl_backend_ramdisk_create(struct ctl_be
 
 	STAILQ_INIT(&be_lun->cont_queue);
 	sx_init(&be_lun->page_lock, "cram page lock");
-	if (be_lun->cap_bytes == 0)
+	if (be_lun->cap_bytes == 0) {
+		be_lun->indir = 0;
 		be_lun->pages = malloc(be_lun->pblocksize, M_RAMDISK, M_WAITOK);
+	}
 	be_lun->zero_page = malloc(be_lun->pblocksize, M_RAMDISK,
 	    M_WAITOK|M_ZERO);
 	mtx_init(&be_lun->queue_lock, "cram queue lock", NULL, MTX_DEF);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201702141803.v1EI3HpB072539>