Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1020411pxb; Thu, 28 Jan 2021 06:20:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJylaZ/nFw0y/d139tKH0fZwEr/zgc0DTGQnTjL8y5CMQ93rJMC8G9O/DCFAlZt1KOE6XLvS X-Received: by 2002:a17:906:9616:: with SMTP id s22mr11491262ejx.270.1611843637784; Thu, 28 Jan 2021 06:20:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611843637; cv=none; d=google.com; s=arc-20160816; b=UKJ/tolJdnwD3CiGeuwLzFfwanVoURN/q1kWz0GyVyG8fMOu8xO7A0sWTQZ3nPn8K1 hYpMwf4tX+I9qh/hyX12EbFzaSydhzcwSLcJ3tzrZZeaweHHlVNAlUBMtDd0tB/uzTMb Ny4j919G5xx0+RUIIZERtdhihhg7+7UOBdHyAADnsDlcHRycQtk1c8w2AaSxsWN6ODzV bBvMOEZ4nG+NYw7GjEwNxehRBKwhe+BgDoweH+cERwaK+vEguwwUJEANhpKwn8lJt3W5 MhgzieW7k8RVWPt4nYDXZROmVCH6oQxMQtVrvsMLdDFPaScbczmd7gGLDbtBC9Rj5qs5 wThg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=82FN5PNqEoj/mvZFSbez/zX7p4CTgWs6rdhQWNIXhYA=; b=szKaLj0o9pfTdE/uAYWwRtpomVDcG8ebbtz5KDnaggBBEUq3T6hLPyNntErvjk8D1G gH7HG0S5X1/f7gZIdENATFLCzRYvEctv0rZu+wxy8sPmeT4r1Fp+IccI/EAXAPr+bLCr DvaDTlqZjnalFQFwW8E2DEJWCBjZUE5ElG1UoFwvaUPMs/LAUASjGhQukQTGP7c1skAQ DsJbnGMiFPwHAv8z9v4qx4VqBv7xzw3Op3ZNHSoryoQYS1SCRnMywZv6ZrLgh1BToscE OJIkdLWp4cOw46RskbS8OAIa+VD0wOelIrodiXOmQFYriUvnFF/HxbULR9N2rs1Q5vnh oWxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@android.com header.s=20161025 header.b=fBFFUMge; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=android.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lg3si2741859ejb.158.2021.01.28.06.20.12; Thu, 28 Jan 2021 06:20:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@android.com header.s=20161025 header.b=fBFFUMge; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=android.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231259AbhA1OQH (ORCPT + 99 others); Thu, 28 Jan 2021 09:16:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229569AbhA1OQF (ORCPT ); Thu, 28 Jan 2021 09:16:05 -0500 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D520CC061573 for ; Thu, 28 Jan 2021 06:15:24 -0800 (PST) Received: by mail-wr1-x42a.google.com with SMTP id s7so2566710wru.5 for ; Thu, 28 Jan 2021 06:15:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=android.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=82FN5PNqEoj/mvZFSbez/zX7p4CTgWs6rdhQWNIXhYA=; b=fBFFUMgej6bbidDQptcu9Q3KBDcJw5K4oNkt3fFuGYXBfgfPL7NCJrKqqzWvrGMiEz lVi8tPTgd0l166n3CSUvawgWXcHgDeNe41+ZbvCyBHvyXFyLmYRrzZcGLFeB88Ynz/oz cPoSGXqwl0HHD0Ji2Gh3vHc0qe0w/WRlBBMqsOrJUGLjFLRqIk1h5uRNtOR/ncuGTwj+ byp7Ha4hwg9Yg+Jw1UbvEeJdKfBqpsmtJxvjHWVTTPohDf5awl07UBsbtmqvJtc7hRzU 5OGuLZy8Rr/a7Vc+ZJekDhj/RpkJEQf7VGsz5IqgmXyiACEym25qyXh0U3mLnjXz7WX2 i8aQ== 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:references :mime-version:content-disposition:in-reply-to; bh=82FN5PNqEoj/mvZFSbez/zX7p4CTgWs6rdhQWNIXhYA=; b=nAc0zZxbU+AphBPF3/vUnIi8EQK6zJ059l92Fp8sFyAj+FyoGcgDoqf4oPHFjUywxR 5SmYsT4m0/mneJNp8KatOMdXchWHRLTaou9X2BP9NFhAVymc1ux0/jY8rg4MG+jolG5F +0gx9rdMPOhB2hZtqII7NXxA1890T1TIduPPbeyOgmGrcR7BSWUGuCQd1rgmcHI4m7UR b/zlOcvW92nH86ijS+2bKh5Xlf6RioRFH4Q4Y+h4UZKkpmW6LsckVHVopd1rkuzcxRS7 RJIQkMny3HWgdCrtMMxKkdfO44ssis8RlGfVK8713Ryn1T3IJqKdKbnWnB02/AoTACQa /5yw== X-Gm-Message-State: AOAM531mRdzpmtZpfUZsrHWACRuTMuH3psKg1wcTgYUb+G9nNIY3ZnUh Ji3aq733Wyw0eI2OUf7fHtr8gQ== X-Received: by 2002:a5d:664c:: with SMTP id f12mr16450473wrw.61.1611843323446; Thu, 28 Jan 2021 06:15:23 -0800 (PST) Received: from google.com ([2a00:79e0:d:210:a080:4cd9:70a6:2d2]) by smtp.gmail.com with ESMTPSA id l14sm6792371wrq.87.2021.01.28.06.15.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 06:15:22 -0800 (PST) Date: Thu, 28 Jan 2021 14:15:21 +0000 From: Alessio Balsini To: qxy Cc: Alessio Balsini , Miklos Szeredi , Akilesh Kailash , Amir Goldstein , Antonio SJ Musumeci , David Anderson , Giuseppe Scrivano , Jann Horn , Jens Axboe , Martijn Coenen , Palmer Dabbelt , Paul Lawrence , Peng Tao , Stefano Duo , Zimuzo Ezeozue , wuyan , fuse-devel@lists.sourceforge.net, kernel-team@android.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RESEND V12 2/8] fuse: 32-bit user space ioctl compat for fuse device Message-ID: References: <20210125153057.3623715-1-balsini@android.com> <20210125153057.3623715-3-balsini@android.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, I'm more than happy to change the interface into something that is objectively better and accepted by everyone. I would really love to reach the point at which we have a "stable-ish" UAPI as soon as possible. I've been thinking about a few possible approaches to fix the issue, yet to preserve its flexibility. These are mentioned below. Solution 1: Size As mentioned in my previous email, one solution could be to introduce the "size" field to allow the structure to grow in the future. struct fuse_passthrough_out { uint32_t size; // Size of this data structure uint32_t fd; }; The problem here is that we are making the promise that all the upcoming fields are going to be maintained forever and at the offsets they were originally defined. Solution 2: Version Another solution could be to s/size/version, where for every version of FUSE passthrough we reserve the right to modifying the fields over time, casting them to the right data structure according to the version. Solution 3: Type Using an enumerator to define the data structure content and purpose is the most flexible solution I can think of. This would for example allow us to substitute FUSE_DEV_IOC_PASSTHROUGH_OPEN with the generic FUSE_DEV_IOC_PASSTHROUGH and having a single ioctl for any eventually upcoming passthrough requests. enum fuse_passthrough_type { FUSE_PASSTHROUGH_OPEN }; struct fuse_passthrough_out { uint32_t type; /* as defined by enum fuse_passthrough_type */ union { uint32_t fd; }; }; This last is my favorite, as regardless the minimal logic required to detect the size and content of the struct (not required now as we only have a single option), it would also allow to do some kind of interface versioning (e.g., in case we want to implement FUSE_PASSTHROUGH_OPEN_V2). What do you think? Thanks, Alessio P.S. Sorry if you received a duplicate email. I first sent this in reply to an email without realizing it was a private message. On Thu, Jan 28, 2021 at 11:01:59AM +0800, qxy wrote: > Hi Alessio, > > I have received a failure from the Mail Delivery System for times and feel > really sorry if you have already received the duplicate message... > > Thank you for your reply. > I think it's wonderful to remove *vec from the data structure fields since > we consider that it is not a good idea to use pointer when there is a need > for cross-platform. > Do you have a plan to modify the kernel fuse_passthrough_out data structure > the same way as you mentioned? > > Thanks! > qixiaoyu