andy-js 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 was hoping nobody would pick up on this.

So here's the deal: most of the functions in libzfs_core leave errno set to 
whatever value was set by iocl(2).  Even though they return the error many 
calls in libzfs rely on this being set.

What I'd rather is to address that in a different changeset, since there are a 
number of areas in the code that need to be updated, and I feel that's outside 
the scope of this change.

While it's not exactly right, it's not exactly wrong either.

-- 
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_r120881360
------------------------------------------
openzfs-developer
Archives: 
https://openzfs.topicbox.com/groups/developer/discussions/T3d8522d1a7ad5f47-M382addf1df149f853c942336
Powered by Topicbox: https://topicbox.com

Reply via email to