daemon/job: fix receiving-job root-fs overlap detection

fixup for 7756c9a5
fixes #160
This commit is contained in:
Christian Schwarz 2019-03-26 12:08:56 +01:00
parent 5b256a92b3
commit f31b54582f

View File

@ -25,13 +25,13 @@ func JobsFromConfig(c *config.Config) ([]Job, error) {
// receiving-side root filesystems must not overlap // receiving-side root filesystems must not overlap
{ {
rfss := make([]string, len(js)) rfss := make([]string, 0, len(js))
for i, j := range js { for _, j := range js {
jrfs, ok := j.OwnedDatasetSubtreeRoot() jrfs, ok := j.OwnedDatasetSubtreeRoot()
if !ok { if !ok {
continue continue
} }
rfss[i] = jrfs.ToString() rfss = append(rfss, jrfs.ToString())
} }
if err := validateReceivingSidesDoNotOverlap(rfss); err != nil { if err := validateReceivingSidesDoNotOverlap(rfss); err != nil {
return nil, err return nil, err