Bug 197821 - zfs list -t bookmark doesn't work on zvol
Summary: zfs list -t bookmark doesn't work on zvol
Status: In Progress
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 12.0-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: Andriy Gapon
Keywords: patch
Depends on:
Reported: 2015-02-19 13:53 UTC by cryx-freebsd
Modified: 2019-08-12 10:02 UTC (History)
3 users (show)

See Also:

Fix for the problem (478 bytes, patch)
2015-02-20 21:04 UTC, cryx-freebsd
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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
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 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

  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