Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp762046ybe; Wed, 4 Sep 2019 07:24:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqwdRfryCYE4LEjv/P7VnYNdykp8F/ZJrCs5tY2WnrmIZn5kJuQdjbtMNM0puUyvtGRBhLgI X-Received: by 2002:a17:902:24c:: with SMTP id 70mr40083994plc.331.1567607056523; Wed, 04 Sep 2019 07:24:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567607056; cv=none; d=google.com; s=arc-20160816; b=cXTweHw/JxyWhIQ4HaHVOY2PK+2Eb40yzIhECUQg+1AFkJfC3gBUuHx0pSh0sYtqaL FZRAIvQHYAJmoU4fsjVDqcBcQ22rP1FExQLt/hE7gpnzhrQlL/4hrne+Eo/9hZCGB8oe ukc32vnTL97AFicHSYA11qrfWPrh7KFu8hUPFvuO0hIFn0kglWgKTVVIXbqWrRRqqtLt 2HhSwJX5KwN7w1yUxhoia+Fb/ztNvVxbrAnigAnSyiEmZEeITurugz4LRLuX8MHBTTiY eopeoUkRQqrC0h0uBWwysHh+Zei/OqjhdzBDnEFEj6bkZfUgdJrEoZyLZ75CQPeZi5ky vSsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Ai4BzaTagfKa+pTDibngfEsW6tHKMwJydq+XU/9ptBk=; b=Rolav4IMchzh5+SXeLEJUDBRTF9h+J8ELIZ04kqJGHjWQ3BIZ+omCxz6WxFekqyodE hNimM0HiZ4K4aGs0C8Rl+1kXaa74fShwBH7uVjCIxIfD5/vZE1LqtkwugV+P5T4Uol+t D77/IAST6z+XqJk4CaUpWnuT2ChIqMTP66nzgfLpqaTrtWAEtPo+8d1BVs7Ud7nPBNEr yUFO5Fzis95qIu5sUPPiJON4v2wkyat8+TK2O9zjVvUZL4beG16mqUxP6KCpA1ndfhCi brKFgGoWNLo8zE9zNbHyG5jP7rFZmbkBcDnunPmBsttZhEiuBxAq0Rea7j50pinoT0cm sdeA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y62si17027745pgy.348.2019.09.04.07.23.59; Wed, 04 Sep 2019 07:24:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730720AbfIDOW4 (ORCPT + 99 others); Wed, 4 Sep 2019 10:22:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50160 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727544AbfIDOW4 (ORCPT ); Wed, 4 Sep 2019 10:22:56 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D2B4C155E0; Wed, 4 Sep 2019 14:22:55 +0000 (UTC) Received: from work-vm (ovpn-117-227.ams2.redhat.com [10.36.117.227]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1FFB7600CD; Wed, 4 Sep 2019 14:22:49 +0000 (UTC) Date: Wed, 4 Sep 2019 15:22:47 +0100 From: "Dr. David Alan Gilbert" To: "Michael S. Tsirkin" Cc: linux-kernel@vger.kernel.org, Miklos Szeredi , linux-fsdevel@vger.kernel.org, stefanha@redhat.com Subject: Re: [PATCH] fuse: reserve byteswapped init opcodes Message-ID: <20190904142247.GM2828@work-vm> References: <20190904123607.10048-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190904123607.10048-1-mst@redhat.com> User-Agent: Mutt/1.12.1 (2019-06-15) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 04 Sep 2019 14:22:55 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Michael S. Tsirkin (mst@redhat.com) wrote: > 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. I think in theory that works even for normal fuse. > Same for CUSE_INIT. > > Signed-off-by: Michael S. Tsirkin > --- > 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..f042e63f4aa0 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 */ > + FUSE_INIT_BSWAP_RESERVED = 26 << 24, FUSE_INIT << 24 probably works? > + CUSE_INIT_BSWAP_RESERVED = 16 << 16, Dave > }; > > enum fuse_notify_code { > -- > MST -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK