[REVIEW] patch for copyout on ioctl error

Matt Olander matt at ixsystems.com
Sun Apr 7 20:07:47 UTC 2013


On Sun, Apr 7, 2013 at 12:29 PM, Martin Matuska <mm at freebsd.org> wrote:
> Hi all,
>
> ZFS expects a copyout of zfs_cmd_t on a ioctl error. Our sys_ioctl()
> doesn't copyout in this case.
>
> I am suggesting the attached patch for review to fix (or workaround)
> this situation.

Nice, thanks Martin! We will try and test it out this week ;)

Cheers,
-matt

>
> The idea is easy - zfs ioctl's won't send zfs_cmd_t anymore but a new
> struct zfs_iocparm_t consisting of just three elements:
> pointer to zfs_cmd_t
> size of zfs_cmd_t
> zfs_ioctl_version
>
> Size of zfs_cmd_t is intended for the kernel to re-verify if talking to
> the correct version. zfs_ioctl_version is for future purposes to make it
> easier for the
> kernel to identify ioctl changes.
>
> The kernel module will do the copyin/copyout of zfs_cmd_t itself (like
> illumos does). This makes future compatibility more simple and
> zfsdev_ioctl() behaves much more like in illumos. The patch retains
> compatibility with all previous states.
>
> Cheers,
> mm
>
> --
> Martin Matuska
> FreeBSD committer
> http://blog.vx.sk
>
>
> _______________________________________________
> zfs-devel at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/zfs-devel
> To unsubscribe, send any mail to "zfs-devel-unsubscribe at freebsd.org"


More information about the zfs-devel mailing list