endpoint: Receiver: only create placeholders below root_fs

fixes #195
This commit is contained in:
Christian Schwarz
2019-09-07 20:01:15 +02:00
parent 921b34235e
commit d81a1818d6
2 changed files with 12 additions and 0 deletions
+3
View File
@@ -78,6 +78,9 @@ func ZFSGetFilesystemPlaceholderState(p *DatasetPath) (state *FilesystemPlacehol
}
func ZFSCreatePlaceholderFilesystem(p *DatasetPath) (err error) {
if p.Length() == 1 {
return fmt.Errorf("cannot create %q: pools cannot be created with zfs create", p.ToString())
}
cmd := exec.Command(ZFS_BINARY, "create",
"-o", fmt.Sprintf("%s=%s", PlaceholderPropertyName, placeholderPropertyOn),
"-o", "mountpoint=none",