svn commit: r258871 - head/sys/cam/ctl
Edward Tomasz Napierala
trasz at FreeBSD.org
Tue Dec 3 18:04:14 UTC 2013
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);
More information about the svn-src-all
mailing list