From owner-svn-src-all@freebsd.org Tue Feb 21 05:13:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66CF8CE7F5C; Tue, 21 Feb 2017 05:13:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 339B23F4; Tue, 21 Feb 2017 05:13:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1L5DGGq086369; Tue, 21 Feb 2017 05:13:16 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1L5DGTJ086368; Tue, 21 Feb 2017 05:13:16 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201702210513.v1L5DGTJ086368@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 21 Feb 2017 05:13:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r314026 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Feb 2017 05:13:17 -0000 Author: mav Date: Tue Feb 21 05:13:16 2017 New Revision: 314026 URL: https://svnweb.freebsd.org/changeset/base/314026 Log: MFC r313736: Fix panic on shutdown of ramdisk LU with zero capacity. Modified: stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Tue Feb 21 05:12:42 2017 (r314025) +++ stable/10/sys/cam/ctl/ctl_backend_ramdisk.c Tue Feb 21 05:13:16 2017 (r314026) @@ -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);