From: Niclas Berglind Date: Fri, 4 Apr 2014 22:14:40 +0000 (+0200) Subject: Minor fixes to Dataset and Zvol constructors. X-Git-Url: http://git.datanom.net/omvzfs.git/commitdiff_plain/67b3738d3d9a7cd2befda8b695411383015a481d Minor fixes to Dataset and Zvol constructors. Signed-off-by: Niclas Berglind --- diff --git a/src/Dataset.php b/src/Dataset.php index 19dbc67..f61baa1 100644 --- a/src/Dataset.php +++ b/src/Dataset.php @@ -68,12 +68,10 @@ class OMVModuleZFSDataset { $ds_exists = false; } if ($ds_exists) { - $cmd = "zfs list -r -o name -H -t snapshot " . $name . " 2>&1"; + $cmd = "zfs list -r -d 1 -o name -H -t snapshot " . $name . " 2>&1"; $this->exec($cmd, $out2, $res2); foreach ($out2 as $line2) { - if (preg_match('/^' . preg_quote($name, '/') . '\@.*$/', $line2)) { $this->snapshots[$line2] = new OMVModuleZFSSnapshot($line2); - } } } else { $this->create(); diff --git a/src/Zvol.php b/src/Zvol.php index aea0ca2..fb86eeb 100644 --- a/src/Zvol.php +++ b/src/Zvol.php @@ -69,7 +69,7 @@ class OMVModuleZFSZvol { $zvol_exists = false; } if ($zvol_exists) { - $cmd = "zfs list -r -o name -H -t snapshot " . $name . " 2>&1"; + $cmd = "zfs list -r -d 1 -o name -H -t snapshot " . $name . " 2>&1"; $this->exec($cmd, $out2, $res2); foreach ($out2 as $line2) { $this->snapshots[$line2] = new OMVModuleZFSSnapshot($line2);