From owner-svn-src-all@FreeBSD.ORG Fri Dec 13 21:22:12 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9ADAAA0D; Fri, 13 Dec 2013 21:22:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8788B1EEE; Fri, 13 Dec 2013 21:22:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBDLMCVx028927; Fri, 13 Dec 2013 21:22:12 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBDLMCBg028926; Fri, 13 Dec 2013 21:22:12 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201312132122.rBDLMCBg028926@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 13 Dec 2013 21:22:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r259332 - releng/10.0/sys/cam/ctl X-SVN-Group: releng 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.17 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: Fri, 13 Dec 2013 21:22:12 -0000 Author: trasz Date: Fri Dec 13 21:22:12 2013 New Revision: 259332 URL: http://svnweb.freebsd.org/changeset/base/259332 Log: MFC r258871: Properly report an error instead of panicing when user tries to create LUN backed by non-disk device, e.g. /dev/null. Approved by: re (glebius) Sponsored by: The FreeBSD Foundation Modified: releng/10.0/sys/cam/ctl/ctl_backend_block.c Directory Properties: releng/10.0/ (props changed) Modified: releng/10.0/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- releng/10.0/sys/cam/ctl/ctl_backend_block.c Fri Dec 13 20:54:45 2013 (r259331) +++ releng/10.0/sys/cam/ctl/ctl_backend_block.c Fri Dec 13 21:22:12 2013 (r259332) @@ -1485,6 +1485,7 @@ ctl_be_block_close(struct ctl_be_block_l case CTL_BE_BLOCK_FILE: break; case CTL_BE_BLOCK_NONE: + break; default: panic("Unexpected backend type."); break; @@ -1503,6 +1504,7 @@ ctl_be_block_close(struct ctl_be_block_l } break; case CTL_BE_BLOCK_NONE: + break; default: panic("Unexpected backend type."); break; @@ -1589,7 +1591,7 @@ ctl_be_block_open(struct ctl_be_block_so } else { error = EINVAL; snprintf(req->error_str, sizeof(req->error_str), - "%s is not a disk or file", be_lun->dev_path); + "%s is not a disk or plain file", be_lun->dev_path); } VOP_UNLOCK(be_lun->vn, 0);