On Thu, Jan 28, 2021 at 3:17 PM Alessio Balsini <balsini@xxxxxxxxxxx> wrote: > > Hi all, > > I'm more than happy to change the interface into something that is > objectively better and accepted by everyone. > I would really love to reach the point at which we have a "stable-ish" > UAPI as soon as possible. It's in the mainline kernel, so you already have a stable uapi and cannot change that in any incompatible way! > I've been thinking about a few possible approaches to fix the issue, yet > to preserve its flexibility. These are mentioned below. > > > Solution 1: Size > > As mentioned in my previous email, one solution could be to introduce > the "size" field to allow the structure to grow in the future. > > struct fuse_passthrough_out { > uint32_t size; // Size of this data structure > uint32_t fd; > }; > > The problem here is that we are making the promise that all the upcoming > fields are going to be maintained forever and at the offsets they were > originally defined. > > > Solution 2: Version > > Another solution could be to s/size/version, where for every version of > FUSE passthrough we reserve the right to modifying the fields over time, > casting them to the right data structure according to the version. Please read Documentation/driver-api/ioctl.rst for how to design ioctls. Neither 'size' nor 'version' fields are appropriate here. If you have a new behavior, you need a new command code. Arnd