From: Miklos Szeredi <mszeredi@redhat.com>
To: virtualization@lists.linux-foundation.org, linux-fsdevel@vger.kernel.org
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
linux-kernel@vger.kernel.org,
Stefan Hajnoczi <stefanha@redhat.com>,
Vivek Goyal <vgoyal@redhat.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>
Subject: [PATCH v5 1/4] fuse: reserve byteswapped init opcodes
Date: Tue, 10 Sep 2019 17:12:03 +0200 [thread overview]
Message-ID: <20190910151206.4671-2-mszeredi@redhat.com> (raw)
In-Reply-To: <20190910151206.4671-1-mszeredi@redhat.com>
From: "Michael S. Tsirkin" <mst@redhat.com>
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 <mst@redhat.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
---
include/uapi/linux/fuse.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/uapi/linux/fuse.h b/include/uapi/linux/fuse.h
index 2971d29a42e4..df2e12fb3381 100644
--- a/include/uapi/linux/fuse.h
+++ b/include/uapi/linux/fuse.h
@@ -425,6 +425,10 @@ enum fuse_opcode {
/* CUSE specific operations */
CUSE_INIT = 4096,
+
+ /* Reserved opcodes: helpful to detect structure endian-ness */
+ CUSE_INIT_BSWAP_RESERVED = 1048576, /* CUSE_INIT << 8 */
+ FUSE_INIT_BSWAP_RESERVED = 436207616, /* FUSE_INIT << 24 */
};
enum fuse_notify_code {
--
2.21.0
next prev parent reply other threads:[~2019-09-10 15:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-10 15:12 [PATCH v5 0/4] virtio-fs: shared file system for virtual machines Miklos Szeredi
2019-09-10 15:12 ` Miklos Szeredi [this message]
2019-09-10 15:12 ` [PATCH v5 2/4] fuse: reserve values for mapping protocol Miklos Szeredi
2019-09-10 15:12 ` [PATCH v5 3/4] virtio-fs: add Documentation/filesystems/virtiofs.rst Miklos Szeredi
2019-09-10 15:12 ` [PATCH v5 4/4] virtio-fs: add virtiofs filesystem Miklos Szeredi
2019-09-11 12:24 ` [PATCH v5 0/4] virtio-fs: shared file system for virtual machines Stefan Hajnoczi
2019-09-11 14:52 ` Vivek Goyal
2019-09-12 7:34 ` Miklos Szeredi
2019-09-11 15:52 ` Stefan Hajnoczi
2019-09-12 8:14 ` Miklos Szeredi
2019-09-12 12:54 ` Stefan Hajnoczi
2019-09-12 13:06 ` Miklos Szeredi
2019-09-12 14:12 ` Miklos Szeredi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190910151206.4671-2-mszeredi@redhat.com \
--to=mszeredi@redhat.com \
--cc=dgilbert@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=stefanha@redhat.com \
--cc=vgoyal@redhat.com \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).