scstadmin: Restore support for replacing LUNs that are inside a group

Fixes: a3266ca8f2 ("scstadmin: Remove support for the "new" sysfs interface")
Reported-by: Pavel Klevtsov


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9172 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2020-10-14 03:31:59 +00:00
parent a4ea5c02e1
commit 2fb10fb2ff

View File

@@ -2223,8 +2223,14 @@ sub replaceLun {
$o_string =~ s/\s$//;
my ($path, $cmd);
$path = make_path(SCST_TARGETS_DIR(), $driver, $target, SCST_LUNS,
SCST_MGMT_IO);
if (defined($group)) {
$path = make_path(SCST_TARGETS_DIR(), $driver, $target,
SCST_GROUPS, $group, SCST_LUNS,
SCST_MGMT_IO);
} else {
$path = make_path(SCST_TARGETS_DIR(), $driver, $target,
SCST_LUNS, SCST_MGMT_IO);
}
$cmd .= "replace $device $lun $o_string";
my $bytes = - ENOENT;