Bug 225223 - "zfs rename -r" of a snapshot doesn't rename zvol snapshots' device nodes
Summary: "zfs rename -r" of a snapshot doesn't rename zvol snapshots' device nodes
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 16:20 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 16:20:20 UTC
ZFS creates device nodes for every zvol and every snapshot of a zvol.  If you rename a snapshot on a zvol, the device node will automatically get renamed too.  However, if you use "zfs rename -r" (-r means recursive) on a snapshot of the zvol's parent dataset, then the snapshot's device node will _not_ get renamed.

Steps to reproduce:
[alans@tom ~]$ sudo zpool create foo da1
[alans@tom ~]$ sudo zfs create -V 100m foo/vol0
[alans@tom ~]$ sudo zfs snapshot -r foo@0
[alans@tom ~]$ find /dev/zvol/foo/ -type c
/dev/zvol/foo/vol0
/dev/zvol/foo/vol0@0
[alans@tom ~]$ sudo zfs rename -r foo@0 foo@1
[alans@tom ~]$ find /dev/zvol/foo/ -type c
/dev/zvol/foo/vol0
/dev/zvol/foo/vol0@0
[alans@tom ~]$ zfs list -t all -r foo/vol0
NAME         USED  AVAIL  REFER  MOUNTPOINT
foo/vol0     105M  3.51T    56K  -
foo/vol0@1      0      -    56K  -

/dev/zvol/foo/vol0@0 should've been renamed to /dev/zvol/foo/vol0@1 .
Comment 1 commit-hook freebsd_committer freebsd_triage 2018-01-30 16:24:18 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