Date: Tue, 3 Dec 2013 18:04:14 +0000 (UTC) From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258871 - head/sys/cam/ctl Message-ID: <201312031804.rB3I4El2026035@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: trasz Date: Tue Dec 3 18:04:14 2013 New Revision: 258871 URL: http://svnweb.freebsd.org/changeset/base/258871 Log: Properly report an error instead of panicing when user tries to create LUN backed by non-disk device, e.g. /dev/null. Reviewed by: ken (earlier version) MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/cam/ctl/ctl_backend_block.c Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Tue Dec 3 16:07:56 2013 (r258870) +++ head/sys/cam/ctl/ctl_backend_block.c Tue Dec 3 18:04:14 2013 (r258871) @@ -1483,6 +1483,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; @@ -1501,6 +1502,7 @@ ctl_be_block_close(struct ctl_be_block_l } break; case CTL_BE_BLOCK_NONE: + break; default: panic("Unexpected backend type."); break; @@ -1587,7 +1589,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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201312031804.rB3I4El2026035>