Skip to content
This repository was archived by the owner on Jul 25, 2024. It is now read-only.
This repository was archived by the owner on Jul 25, 2024. It is now read-only.

ZPool.datasets() doesn't list all available datasets #79

Description

@mskarbek

Quite possibly I don't understand something, I have just begun my Rust adventure ;) and right away started playing with libraries that are touching filesystems but this seems to be straightforward yet does not work as I imagine it should.

Simple code:

extern crate libzfs;

use libzfs::{Libzfs};

fn main() {
    let mut libzfs = Libzfs::new();
    let pools = libzfs.get_imported_pools().unwrap();
    for pool in pools {
        let datasets = pool.datasets().unwrap();
        for dataset in datasets {
            println!("{:?}", dataset.name());
        }
    }
}

Result:

"d1226526151549b6a14a18c6217f17bf/home"
"d1226526151549b6a14a18c6217f17bf/var"

Expected:

"d1226526151549b6a14a18c6217f17bf"
"d1226526151549b6a14a18c6217f17bf/home"
"d1226526151549b6a14a18c6217f17bf/home/core"
"d1226526151549b6a14a18c6217f17bf/var"
"d1226526151549b6a14a18c6217f17bf/var/lib"
"d1226526151549b6a14a18c6217f17bf/var/lib/containers"
"d1226526151549b6a14a18c6217f17bf/var/lib/containers/83abdad1a6e9eae57f0ce0eb803b21bc9f246196e52716f1ea96ec70a6fe7b9e"
"d1226526151549b6a14a18c6217f17bf/var/lib/docker"

Used:

  • zfs: zfs-0.7.11-1.fc28.x86_64
  • libzfs: 0.6.13

Interestingly I am able to access not listed datasets by calling dataset_by_name() for example libzfs.dataset_by_name("d1226526151549b6a14a18c6217f17bf/home/core").unwrap() works fine and returns correct data.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions