Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp638449ybe; Wed, 4 Sep 2019 05:37:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqzaJ/fKKv8ROtwMKdG0piw5za6u12bx6F6ZLeXUbIg88yuZH3MznuuyJ3nr3zM0TUJsmWDW X-Received: by 2002:aa7:9293:: with SMTP id j19mr47476177pfa.90.1567600667970; Wed, 04 Sep 2019 05:37:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567600667; cv=none; d=google.com; s=arc-20160816; b=JMRBPgGJ41+zB2/yjHQg/EhlUKIkUtkAmxgl5l7aYfGVCwP4b1wQmLYrssco11dwqb 40kMn7W+2SD4GdGBrrapHLQPb9a5JfnbjkNCOA1hO33wxvbNs9KO6I4tnSTre6gVDgcB EObeXL4x5+xbV6XsyKipU+WJECTEFzU6tMQK4YUzWwu4D4wxmLxD6LpVL2CPCyUCbEIQ qF6UZFVqYO8Rpc61dIEo9Fhjux+wpkYBUj+uirY1pvwW/9rGYZ0bEc3ChGyoDNZlp2WW MIhZci+nOyIgycx7hEv+tMT8nJpkQmJ1Z28t2YJH0YXk/v1R61v6fyiK2kqB3E+KCqNH 19TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :message-id:subject:cc:to:from:date; bh=Y7+4jzmWO4GQ/wOMEZ/4ITLQiTP1h3eEC+zHNesrpcA=; b=WwU6udT7o1AkycfSfIBcWX0trwrDT0ZILtztbN1rHZU4SWRmtKzJ9s4jTWfRK6uSwO l4BiMHm2er9XCdWbMZ00VWSgUOW9K8ntID5ztd0sUqB5Sxf997OKvYnQFAiM9xD52mZF uk+NWDo9U/kJ4kaYbyOkORbpq77ckJDcBd8pG10FreFHn8wXiBpTpCGMeywuaWxSUvtM N6uOxh1+s0QA4fsaV6Iu6X8gztZ0MinVhH14Tyx/UQ+kAQtyN4H+LB0xO1F8k77hRUnB n7a+/Lh61GlDlTM4Um/hPmVDEk8tBnXx+Mi4DxuwC5AzRlV+k9mtg8bRw2Vi6E721WYJ hrdw== 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 z72si16751566pgd.34.2019.09.04.05.37.32; Wed, 04 Sep 2019 05:37:47 -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 S1729975AbfIDMgk (ORCPT + 99 others); Wed, 4 Sep 2019 08:36:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50056 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727083AbfIDMgj (ORCPT ); Wed, 4 Sep 2019 08:36:39 -0400 Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8C3D1C05686D for ; Wed, 4 Sep 2019 12:36:39 +0000 (UTC) Received: by mail-qk1-f198.google.com with SMTP id b67so10689943qkc.1 for ; Wed, 04 Sep 2019 05:36:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=Y7+4jzmWO4GQ/wOMEZ/4ITLQiTP1h3eEC+zHNesrpcA=; b=EvmoBczvCCsNLAeKGo9l6AfKROCwK4mCDvR01D/DSQY1BmAZM8hh1jDY2asMD02Jze 9BoxxzAzotpvrurclOaqVIXwRzlZyEs7NK98c7ivj4OHkEDKu1kTXOEinKQBBvZzUFQU ObtiK+FBMNx0fAARUmqUZWnwf2v/3loJApebMgFtFDKTmi3pH+a1Ny71j4kpFFuk163H hqSkf5VN+s1O6Skv9p5Hm0Y9HyWSId2f8uURCYAVpbK+DQ4h/vf+ISq56ZBiPu2wRpP2 YKTXe8AliVaML3tNNdx4Jh8zX7/D1tutjygsDFWrPHQb/+Eil6/VK49tTuaRlkrf8mpZ mm4Q== X-Gm-Message-State: APjAAAWENZcqJiGC667+KxJHU9O5gxESw4WbGvRJY/x127+hG/V8pa2+ mXlJ8mKryFjPx0NyNqW60mqgy+VX8tVsShupXjvg34kA+OgSOno+6NYv0lgeM/BLrKn2WrB4+F3 zw6Jwh2peixYO8q+IhSRfjTih X-Received: by 2002:ac8:5388:: with SMTP id x8mr37130972qtp.26.1567600598619; Wed, 04 Sep 2019 05:36:38 -0700 (PDT) X-Received: by 2002:ac8:5388:: with SMTP id x8mr37130953qtp.26.1567600598487; Wed, 04 Sep 2019 05:36:38 -0700 (PDT) Received: from redhat.com (bzq-79-176-40-226.red.bezeqint.net. [79.176.40.226]) by smtp.gmail.com with ESMTPSA id s23sm11658356qte.72.2019.09.04.05.36.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2019 05:36:37 -0700 (PDT) Date: Wed, 4 Sep 2019 08:36:33 -0400 From: "Michael S. Tsirkin" To: linux-kernel@vger.kernel.org Cc: Miklos Szeredi , linux-fsdevel@vger.kernel.org, stefanha@redhat.com, dgilbert@redhat.com Subject: [PATCH] fuse: reserve byteswapped init opcodes Message-ID: <20190904123607.10048-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailer: git-send-email 2.22.0.678.g13338e74b8 X-Mutt-Fcc: =sent Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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, + CUSE_INIT_BSWAP_RESERVED = 16 << 16, }; enum fuse_notify_code { -- MST