Skip to content

Renaming a zvol does not update the kstat's dataset_name #15482

Closed
@asomers

Description

@asomers

System information

Type Version/Name
Operating System Name FreeBSD
Distribution Version 15.0-CURRENT
Kernel Version git main, as of 6-Oct 2023. 13.1-RELEASE and 13.2-RELEASE are also affected
Architecture amd64
OpenZFS Version zfs-2.2.99-FreeBSD_g0ee9b0239 zfs-kmod-2.2.99-FreeBSD_gf795e90a1
Type Version/Name
Operating System Name Debian GNU/Linux
Distribution Version 11.6
Kernel Version 5.10.0-21-amd64
Architecture amd64
OpenZFS Version zfs-2.0.3-9 zfs-kmod-2.0.3-9

Describe the problem you're observing

The kstat.zfs.<POOLNAME>.dataset.objset-0x<OBJID> sysctl nodes publish statistics about ZFS datasets, such as throughput. The "dataset_name" node contains the name of the ZFS dataset. For file system datasets, renaming the dataset also updates the value of dataset_name. But for zvols, it does not. After the rename, dataset_name still contains the dataset's prior name.

Describe how to reproduce the problem

These instructions work on FreeBSD. For Linux, do cat /proc/spl/kstat/zfs/testpool/objset-XXX instead of using sysctl.

$ zpool create testpool vtbd1
$ zfs create -V1m testpool/testvol
$ sysctl -n kstat.zfs.testpool.dataset.objset-$(printf 0x%x $(zfs get -Hpo value objsetid testpool/testvol)).dataset_name
testpool/testvol
$ sudo zfs rename testpool/testvol testpool/yyy
$ sysctl -n kstat.zfs.testpool.dataset.objset-$(printf 0x%x $(zfs get -Hpo value objsetid testpool/yyy)).dataset_name
testpool/testvol

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: DefectIncorrect behavior (e.g. crash, hang)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions