From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D117C433E0 for ; Thu, 28 Jan 2021 14:16:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 23C8B61481 for ; Thu, 28 Jan 2021 14:16:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231285AbhA1OQH (ORCPT ); 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-Google-Smtp-Source: ABdhPJyXYqeZ3302QBKgfqK55u3wRvF3uxxr3cTTMdkXJZ+7oxjyCPXDqpbSOjhzBtVfBpdxKSPzlA== 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