Bug 225200 - "zfs promote" of a zvol doesn't rename device nodes for snapshots
Summary: "zfs promote" of a zvol doesn't rename device nodes for snapshots
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Alan Somers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-16 00:26 UTC by Alan Somers
Modified: 2024-11-25 06:00 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Somers freebsd_committer freebsd_triage 2018-01-16 00:26:01 UTC
A "zfs promote" operation renames the snapshot that was the basis for the cloned dataset.  If that dataset is a zvol, then the snapshot has an associated device node.  That device node should be renamed by "zfs promote", but it doesn't.

Steps to reproduce:
[alans@tom ~]$ sudo zpool create -f foo da1
[alans@tom ~]$ sudo zfs create -V 100m foo/vol0
[alans@tom ~]$ sudo zfs snapshot foo/vol0@snap
[alans@tom ~]$ sudo zfs clone foo/vol0@snap foo/vol1
[alans@tom ~]$ ls -l /dev/zvol/foo/
total 0
crw-r-----  1 root  operator   0x85 Jan 15 17:24 vol0
crw-r-----  1 root  operator  0x130 Jan 15 17:24 vol0@snap
crw-r-----  1 root  operator  0x131 Jan 15 17:24 vol1
[alans@tom ~]$ sudo zfs promote foo/vol1
[alans@tom ~]$ ls -l /dev/zvol/foo/
total 0
crw-r-----  1 root  operator   0x85 Jan 15 17:24 vol0
crw-r-----  1 root  operator  0x130 Jan 15 17:24 vol0@snap
crw-r-----  1 root  operator  0x131 Jan 15 17:24 vol1

The "vol0@snap" node should've been renamed to "vol1@snap".  After a reboot, it does get the correct name.
Comment 1 commit-hook freebsd_committer freebsd_triage 2018-01-30 16:25:21 UTC
A commit references this bug:

Author: asomers
Date: Tue Jan 30 16:24:15 UTC 2018
New revision: 328592
URL: https://svnweb.freebsd.org/changeset/base/328592

Log:
  Mark zvol_misc_007_pos and zvol_misc_008_pos as expected failures

  PR:		225223
  PR:		225200
  Sponsored by:	Spectra Logic Corp

Changes:
  projects/zfsd/head/tests/sys/cddl/zfs/tests/zvol/zvol_misc/zvol_misc_test.sh