Actions
Bug #5521
openzfs hold with empty tag prints the wrong error message
Start date:
2015-01-10
Due date:
% Done:
0%
Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage
Gerrit CR:
Description
The hold ioctl handler returns EINVAL in one of two
cases:
- the hold tag is empty (new)
- user wanted to put a hold on something that's not a snapshot (existing)
Sadly, the ioctl return value makes its way to libzfs (zfs_hold_nvl), which does what libzfs does - prints an error message.
http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libzfs/common/libzfs_dataset.c#4305
It of course assumes that we got an EINVAL because of case #2 and so the user sees:
"operation not applicable to datasets of this type"
My best idea is to add a empty-tag check to libzfs.
A way to test:
$ zfs hold '' storage/upstream@9e835c7628dd0e7764a8341a1774a878dc0b024f cannot hold: operation not applicable to datasets of this type
Related issues
Actions