scst_vdisk: Check that "filename" is specified at most once

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5255 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2014-01-31 02:33:11 +00:00
parent bd53fcd860
commit 4cd021ae86

View File

@@ -4710,6 +4710,12 @@ static int vdev_parse_add_dev_params(struct scst_vdisk_dev *virt_dev,
}
if (!strcasecmp("filename", p)) {
if (virt_dev->filename) {
PRINT_ERROR("%s specified more than once"
" (device %s)", p, virt_dev->name);
res = -EINVAL;
goto out;
}
if (*pp != '/') {
PRINT_ERROR("Filename %s must be global "
"(device %s)", pp, virt_dev->name);