Bug 197821

Summary: zfs list -t bookmark doesn't work on zvol
Product: Base System Reporter: cryx-freebsd
Component: binAssignee: Andriy Gapon <avg>
Status: Closed FIXED    
Severity: Affects Some People CC: avg, cryx-freebsd, pascal.guitierrez
Priority: --- Keywords: patch
Version: 12.0-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Fix for the problem none

Description cryx-freebsd 2015-02-19 13:53:22 UTC
When trying to do a "zfs list -t bookmark" on a zvol I get the error message "operation not applicable to datasets of this type".

# zfs list -o name,type data/zvol
NAME       TYPE
data/zvol  volume
# zfs list -t bookmark -r data/zvol
cannot open 'data/zvol': operation not applicable to datasets of this type

Doing the same with snapshot does work:

# zfs list -t snapshot -r data/zvol
NAME                         USED  AVAIL  REFER  MOUNTPOINT
data/zvol@snapshot          12.8K      -  1.15M  -

Doing it with snapshot and bookmark does work also:

# zfs list -t bookmark,snapshot -r data/zvol
NAME                         USED  AVAIL  REFER  MOUNTPOINT
data/zvol@snapshot          12.8K      -  1.15M  -
data/zvol#bookmark              -      -      -  -
Comment 1 cryx-freebsd 2015-02-20 21:04:23 UTC
Created attachment 153240 [details]
Fix for the problem
Comment 2 pascal.guitierrez 2019-04-02 05:05:04 UTC
(In reply to cryx-freebsd from comment #1)

this problem still exists in freebsd 12.0-release.
did any freebsd devs get back to you regarding this? seems your fix is very simple.
Comment 3 cryx-freebsd 2019-04-02 07:10:00 UTC
No I've got no feedback at all. And you are right, this still exists in 12.0-RELEASE.
Comment 4 commit-hook freebsd_committer freebsd_triage 2019-08-12 10:00:36 UTC
A commit references this bug:

Author: avg
Date: Mon Aug 12 10:00:33 UTC 2019
New revision: 350893
URL: https://svnweb.freebsd.org/changeset/base/350893

Log:
  Allow ZVOL bookmarks to be listed recursively

  Many thanks to cryx-freebsd@h3q.com for reporting the problem and
  submitting a fix.  I have chosen to take an equivalent but textually
  different patch from ZoL just to avoid increasing divergence between
  OpenZFS flavours.

  ZoL commit:	zfsonlinux/zfse33da554c5daf0103b093f44ab5b90ad6c064c3f
  Author:		loli10K <ezomori.nozomu@gmail.com>
  Date:		Wed Sep 7 19:34:20 2016 +0200
  PR:		197821
  Submitted by:	cryx-freebsd@h3q.com (alternative version)
  Reported by:	cryx-freebsd@h3q.com
  Obtained from:	ZoL
  MFC after:	1 week

Changes:
  head/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c
Comment 5 commit-hook freebsd_committer freebsd_triage 2019-08-19 07:45:46 UTC
A commit references this bug:

Author: avg
Date: Mon Aug 19 07:45:40 UTC 2019
New revision: 351208
URL: https://svnweb.freebsd.org/changeset/base/351208

Log:
  MFC r350893: Allow ZVOL bookmarks to be listed recursively

  PR:		197821

Changes:
_U  stable/12/
  stable/12/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c
Comment 6 commit-hook freebsd_committer freebsd_triage 2019-08-19 07:47:47 UTC
A commit references this bug:

Author: avg
Date: Mon Aug 19 07:47:09 UTC 2019
New revision: 351209
URL: https://svnweb.freebsd.org/changeset/base/351209

Log:
  MFC r350893: Allow ZVOL bookmarks to be listed recursively

  PR:		197821

Changes:
_U  stable/11/
  stable/11/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c