Skip to content

Commit 501ae8e

Browse files
mstsirkinMiklos Szeredi
authored andcommitted
fuse: reserve byteswapped init opcodes
virtio fs tunnels fuse over a virtio channel. One issue is two sides might be speaking different endian-ness. To detects this, host side looks at the opcode value in the FUSE_INIT command. Works fine at the moment but might fail if a future version of fuse will use such an opcode for initialization. Let's reserve this opcode so we remember and don't do this. Same for CUSE_INIT. Signed-off-by: Michael S. Tsirkin <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
1 parent 15c8e72 commit 501ae8e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/uapi/linux/fuse.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,10 @@ enum fuse_opcode {
425425

426426
/* CUSE specific operations */
427427
CUSE_INIT = 4096,
428+
429+
/* Reserved opcodes: helpful to detect structure endian-ness */
430+
CUSE_INIT_BSWAP_RESERVED = 1048576, /* CUSE_INIT << 8 */
431+
FUSE_INIT_BSWAP_RESERVED = 436207616, /* FUSE_INIT << 24 */
428432
};
429433

430434
enum fuse_notify_code {

0 commit comments

Comments
 (0)