Commit 4416d540 authored by Mike Hibler's avatar Mike Hibler

"Mike you ignorant ..."

Make sure the FS create actually fails before you cleanup and remove
the new volume...
parent d9188360
......@@ -336,7 +336,7 @@ sub create($$$;$)
my $rv = freenasVolumeCreate($pool, $vol, $size, $sparse);
if ($rv == 0 && $fstype ne "none") {
$rv = freenasFSCreate($pool, $vol, $fstype);
if (freenasVolumeDestroy($pool, $vol)) {
if ($rv && freenasVolumeDestroy($pool, $vol)) {
print STDERR "bscontrol_proxy: could not destroy new volume ".
"after FS creation failure.\n";
}
......
......@@ -336,7 +336,7 @@ sub create($$$;$)
my $rv = freenasVolumeCreate($pool, $vol, $size, $sparse);
if ($rv == 0 && $fstype ne "none") {
$rv = freenasFSCreate($pool, $vol, $fstype);
if (freenasVolumeDestroy($pool, $vol)) {
if ($rv && freenasVolumeDestroy($pool, $vol)) {
print STDERR "bscontrol_proxy: could not destroy new volume ".
"after FS creation failure.\n";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment