Bug #5789
lzc_snapshot() produces inconsistent errlist for different errors
0%
Description
It seems that errlist is inconsistently populated by lzc_snapshot() depending on what problems are encountered.
On the one hand, if I try to create a set of snapshots and some of them already exist, then lzc_snapshot fails and errlist would be correctly populated with the already exisiting snapshots and EEXIST error code.
On the other hand, if I try to create a set of snapshots and some of them (but not all!) refer to filesystems that do not exist, then lzc_snapshot fails with ENOENT but the errlist is not populated. Thus it is impossible to correctly diagnose the failure.
Related issues
Updated by Andriy Gapon about 6 years ago
A more elaborate example. lzc_snapshot() is called to create 3 snapshots: one already exists, one is for a nonexistent filesystem and one could have been successful.
In this case the overall error code is EEXIST and errlist has a single entry for the duplicate snapshot.
The attempt to create the snapshot for nonexistent filesystem is not reported.
Updated by Andriy Gapon about 6 years ago
Apparently zfs_secpolicy_snapshot() is responsible for this behavior.
Updated by Andriy Gapon almost 5 years ago
- Related to Bug #7071: lzc_snapshot does not fill in errlist on ENOENT added