ahrens commented on this pull request.
> zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
"not a cloned filesystem"));
return (zfs_error(hdl, EZFS_BADTYPE, errbuf));
}
- (void) strlcpy(zc.zc_value, zhp->zfs_dmustats.dds_origin,
- sizeof (zc.zc_value));
- (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
- ret = zfs_ioctl(hdl, ZFS_IOC_PROMOTE, &zc);
+ ret = lzc_promote(zhp->zfs_name, snapname, sizeof(snapname));
if (ret != 0) {
int save_errno = errno;
I see that there are some cases where libzfs (incorrectly) uses errno instead
of the return value from `lzc_*` (e.g. `zfs_clone()`), but there are other
cases where it (correctly) uses the return value (e.g. `zfs_snapshot_nvl()`,
`zfs_get_holds()`, `zfs_destroy_snaps_nvl()`).
I don't think that we should add another incorrect use here. This code should
be changed to `switch (ret)`.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openzfs/openzfs/pull/389#discussion_r120884997
------------------------------------------
openzfs-developer
Archives:
https://openzfs.topicbox.com/groups/developer/discussions/T3d8522d1a7ad5f47-M2f126407a63195a842558fec
Powered by Topicbox: https://topicbox.com