From owner-svn-src-stable-9@FreeBSD.ORG Thu May 8 08:17:05 2014 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6AC7F720; Thu, 8 May 2014 08:17:05 +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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5753CD65; Thu, 8 May 2014 08:17:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s488H5bp081579; Thu, 8 May 2014 08:17:05 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s488H5fd081578; Thu, 8 May 2014 08:17:05 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201405080817.s488H5fd081578@svn.freebsd.org> From: Alexander Motin Date: Thu, 8 May 2014 08:17:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r265649 - stable/9/sys/cam/ctl X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2014 08:17:05 -0000 Author: mav Date: Thu May 8 08:17:04 2014 New Revision: 265649 URL: http://svnweb.freebsd.org/changeset/base/265649 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. Modified: stable/9/sys/cam/ctl/ctl_backend_block.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/9/sys/cam/ctl/ctl_backend_block.c Thu May 8 08:15:42 2014 (r265648) +++ stable/9/sys/cam/ctl/ctl_backend_block.c Thu May 8 08:17:04 2014 (r265649) @@ -1518,6 +1518,7 @@ ctl_be_block_close(struct ctl_be_block_l vfs_is_locked = VFS_LOCK_GIANT(be_lun->vn->v_mount); break; case CTL_BE_BLOCK_NONE: + break; default: panic("Unexpected backend type."); break; @@ -1537,6 +1538,7 @@ ctl_be_block_close(struct ctl_be_block_l } break; case CTL_BE_BLOCK_NONE: + break; default: panic("Unexpected backend type."); break; @@ -1626,7 +1628,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); VFS_UNLOCK_GIANT(vfs_is_locked);