zfs_ioc_snapshot_list_next/zfs_ioc_dataset_list_next return ESRCH instead of ENOENT
ENOENT returned from
The latter is the same error that is returned when there is no next entry.
zfs_ioc_dataset_list_next() is called on a missing dataset, then the return code would give an impression that the dataset exists but has not snapshots or children respectively.
I think that both should just return
ENOENT in that case.
One possible concern is an effect of the suggested change on the interaction with concurrent destruction of the dataset.
Currently we would iterate over as much entries as possible and then get
ESRCH meaning that the iteration is finished.
After the change we would get
ENOENT in the middle of the iteration signalling that the dataset has disappeared.
That may not be bad, but possibly could confuse existing consumers.