Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dataset property 'mounted' not updated after mount() #236

Open
1pav opened this issue Jul 12, 2023 · 0 comments
Open

Dataset property 'mounted' not updated after mount() #236

1pav opened this issue Jul 12, 2023 · 0 comments

Comments

@1pav
Copy link

1pav commented Jul 12, 2023

After successfully mounting a ZFS dataset, the value of its 'mounted' property doesn't get updated from 'no' to 'yes'.

I think this is a bug, but if it's an expected behaviour, please close this issue.

Here's a minimal working example to demonstrate the issue:

#!/usr/bin/env python3

from libzfs import ZFS, DatasetType

zfs = ZFS()
pool = zfs.get("tank")
ds_name = "tank/mydataset"

# Create dataset
pool.create(ds_name, {}, fstype=DatasetType.FILESYSTEM, sparse_vol=False, create_ancestors=False)
ds = zfs.get_dataset(ds_name)

# Print 'mounted' property before mount
print(f"BEFORE mount: ds.properties['mounted'].value = {ds.properties['mounted'].value}")

# Mount dataset
ds.mount()

# Optional: force properties refresh
ds.properties['mounted'].refresh()
ds.properties.refresh()

# Print 'mounted' property after mount
print(f"AFTER mount:  ds.properties['mounted'].value = {ds.properties['mounted'].value}")

The output is the following:

BEFORE mount: ds.properties['mounted'].value = no
AFTER mount:  ds.properties['mounted'].value = no

I'm not even sure if those refresh() methods actually do what I think they do, but I added them anyway. Even so, they don't seem to affect the 'mounted' property state.

I can reproduce the issue in the following environment:

  • OS: Rocky Linux 8.8
  • Python: 3.8.16
  • py-libzfs: built from 'master' (commit 91dcc96)
  • ZFS: 2.1.12 (kABI-tracking kmod) (installed from here)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant