Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 37d217f0 authored by Miklos Szeredi's avatar Miklos Szeredi
Browse files

fuse: document protocol version negotiation



Clarify how the protocol version should be negotiated between kernel
and userspace.  Notably libfuse didn't correctly handle the case when
the supported major versions didn't match.

Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
parent 7a6d3c8b
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -41,6 +41,26 @@

#include <linux/types.h>

/*
 * Version negotiation:
 *
 * Both the kernel and userspace send the version they support in the
 * INIT request and reply respectively.
 *
 * If the major versions match then both shall use the smallest
 * of the two minor versions for communication.
 *
 * If the kernel supports a larger major version, then userspace shall
 * reply with the major version it supports, ignore the rest of the
 * INIT message and expect a new INIT message from the kernel with a
 * matching major version.
 *
 * If the library supports a larger major version, then it shall fall
 * back to the major protocol version sent by the kernel for
 * communication and reply with that major version (and an arbitrary
 * supported minor version).
 */

/** Version number of this interface */
#define FUSE_KERNEL_VERSION 7