Commit 221ce815 authored by Mike Hibler's avatar Mike Hibler

If FS creation fails during a volume create, be sure to destroy the volume.

parent 212cb9b0
......@@ -336,6 +336,10 @@ sub create($$$;$)
my $rv = freenasVolumeCreate($pool, $vol, $size, $sparse);
if ($rv == 0 && $fstype ne "none") {
$rv = freenasFSCreate($pool, $vol, $fstype);
if (freenasVolumeDestroy($pool, $vol)) {
print STDERR "bscontrol_proxy: could not destroy new volume ".
"after FS creation failure.\n";
}
}
return $rv;
......
......@@ -336,6 +336,10 @@ sub create($$$;$)
my $rv = freenasVolumeCreate($pool, $vol, $size, $sparse);
if ($rv == 0 && $fstype ne "none") {
$rv = freenasFSCreate($pool, $vol, $fstype);
if (freenasVolumeDestroy($pool, $vol)) {
print STDERR "bscontrol_proxy: could not destroy new volume ".
"after FS creation failure.\n";
}
}
return $rv;
......
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