Re: [RFC v2 10/16] luo: luo_ioctl: add ioctl interface
From: Greg KH
Date: Wed Jul 16 2025 - 05:43:39 EST
On Mon, Jul 14, 2025 at 11:34:43AM -0300, Jason Gunthorpe wrote:
> On Thu, Jul 10, 2025 at 10:26:45AM +0300, Mike Rapoport wrote:
> > IIUC Christian's point was mostly not about using VFS APIs (i.e.
> > read/write) but about using a special pseudo fs rather than devtmpfs to
> > drive ioctls.
> >
> > So instead of
> >
> > fd = open("/dev/liveupdate", ...);
> > ioctl(fd, ...);
> >
> > we'd use
> >
> > fd = open("/sys/fs/kexec/control", ...);
> > ioctl(fd, ...);
>
> Please no, /sys/ is much worse.
>
> /dev/ has lots of infrastructure to control permissions/etc that /sys/
> does not.
>
> If you want to do ioctls to something that you open() is a character
> dev and you accept the limitations with namespaces, coarse permissions
> and so on.
Then use a special filesystem, and not sysfs. It's easy to embed a
virtual filesystem in a driver, please do that instead.
thanks,
greg k-h