Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp382905pxk; Fri, 11 Sep 2020 09:25:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymIC2looE8zt1yJGoVGsK+SkU9q5GMe32c4pB0znB77/TWttBs8v3tovO6pizj1YEwN+rV X-Received: by 2002:aa7:d815:: with SMTP id v21mr3058074edq.56.1599841530574; Fri, 11 Sep 2020 09:25:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599841530; cv=none; d=google.com; s=arc-20160816; b=w/9aWthkAQiei2RuZhozfOjcQXQSzARc07WFw5hXSE+CEIDzi2LZnkuGZED4Lqr7Cj EYCYw8qD/3X8nX4lxrTU4bVWemZta2Y7Q06ZstQLyEETBHLsJkqB7gk8OW2Snp6fBze+ mp84p5Y30muatetXaLwkUlUUEcu3kpSdDM7+8NtkbohO8WBNYgyd7x+tHNszcOr5ZK6Q Q9R+eo26KpRV7kaFckFYmrgg/uOjHko8Y5dg5G6p4DrdixsSRszfgUR852/kEjYlcBYd tAgeu+fy4O9A1mP2EMX8R5eWzrYyqTbmNcETO3A3qZPeu49QZ3sc/KqC0+r2qJawoNxQ oCzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=6SlwUZsnL/qW5jVfhFO7QbUYBoAMLGlcOKF3wt4NfUM=; b=RgrQ/9kb9BcKG1VACKuHJj5qxG71P2ywcJzkjtlqNZuJ/1uq55Skbhk9U2uBufhTbx e+l41zuI+OzyYp/7Ncyj8IiRBNBydYt39eLTqJXU+0jlSFD9Ys1kH2BWhkToNivr5RuE 4KD9EG0papc6xbRxlUI4LMbQZoY2azLlJ5Qzi8jm4hyCppCgyRuFuAPAcWfmkfAGiB7l AZ/nNeAIakwHW6YL0qWPDJmwSFGusnIWqBoMyBgu2wa6sewhTb04wIli6ozAC82M9CL3 LLZmkCUFk5Af65BjSIT4sC4mn+AVLd0PVuYOtE1Mo7hxMByfCgT13TrDn5oCU4zUQloP er1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@android.com header.s=20161025 header.b=HwlnYVl3; 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 f7si1620759ejt.351.2020.09.11.09.25.06; Fri, 11 Sep 2020 09:25:30 -0700 (PDT) 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=HwlnYVl3; 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 S1726214AbgIKQYD (ORCPT + 99 others); Fri, 11 Sep 2020 12:24:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726671AbgIKQXs (ORCPT ); Fri, 11 Sep 2020 12:23:48 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94BBEC061573 for ; Fri, 11 Sep 2020 09:23:48 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id w5so12046551wrp.8 for ; Fri, 11 Sep 2020 09:23:48 -0700 (PDT) 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=6SlwUZsnL/qW5jVfhFO7QbUYBoAMLGlcOKF3wt4NfUM=; b=HwlnYVl3wQKzd3A+zX2xtFIOpottAY358rN9GCQQA73v1qRJMPnmTv6QZ9eGylewQ3 XVx24cJBjtXE0Gv3UgSpqZ5f3Y3ZOqMNGWjK/aJEnSzwKX+WbDsHeRm15P3EZyTsC9Ni boSUYoPFQ7BNnek2wyVuPNkh1q0toYU17HrwtLbcu8eVI9A+tNQpUBaq6QJ63zqxuUCG AT7STseU6xdcDiaMIeCeoDNYldQYscshX/wKz4N7Fi4eBkPoJcjqFvK0y28FjOMUyCJX gSc/d/WlixwdbBh5sRk99nNJIaNeOo5tcDDi4Omoj/lDp0jr7ToBDhLSyIxpzUHA+ApB kvFQ== 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=6SlwUZsnL/qW5jVfhFO7QbUYBoAMLGlcOKF3wt4NfUM=; b=CkLc226T1iV0+jPkPAXBpMwR3io8zLTk5no8uGJcrv7dmYWZ06tQo1aQO+Q0X4zGqH wRqeW585YIPy2CLCt9I+1b3fIaBjzMww2xAB+oQqVRGcYRyhCaQ48wEDqiWcdyJkVY/O 0jTSydFrZ7LpuWN/ztCRMtmlNAqEuJA14dKv2ySF1aesOfG/9JmgE9O2ozWWUy0u20Ja eBclhGaG/NMTeGwqmqsogRk+3qm87awWdTi+NUCK0PTc7qwTp/FpUIDOJQJprJ4+rYZ4 DlHkZrXxEM0GgKpgfyjFcAbJxT/aKO/sZlBt3tH+aA89Aq9+eokRWcDqp+TTGWtEQZxl A0dQ== X-Gm-Message-State: AOAM530GblEB+VgkHOrqowMBRO6eRH4ZywtM5hzTz11IOYhoopko6d4l 0mQp6u0lZuuZ6Uz62qM3TQEyrw== X-Received: by 2002:adf:e9c7:: with SMTP id l7mr2761061wrn.93.1599841427191; Fri, 11 Sep 2020 09:23:47 -0700 (PDT) Received: from google.com ([2a00:79e0:d:210:7220:84ff:fe09:7d5c]) by smtp.gmail.com with ESMTPSA id s124sm5347757wme.29.2020.09.11.09.23.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Sep 2020 09:23:46 -0700 (PDT) Date: Fri, 11 Sep 2020 17:23:45 +0100 From: Alessio Balsini To: Miklos Szeredi Cc: Amir Goldstein , Alessio Balsini , Jann Horn , Jens Axboe , Nikhilesh Reddy , Akilesh Kailash , David Anderson , Eric Yan , Martijn Coenen , Palmer Dabbelt , Paul Lawrence , Stefano Duo , Zimuzo Ezeozue , kernel-team , linux-fsdevel , kernel list Subject: Re: [PATCH v6] fuse: Add support for passthrough read/write Message-ID: <20200911162345.GA71562@google.com> References: <20200812161452.3086303-1-balsini@android.com> <20200813132809.GA3414542@google.com> <20200818135313.GA3074431@google.com> <877dtvb2db.fsf@vostro.rath.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks all for the comments. I have a patchset ready that hopefully wraps together the extendability suggested by Nikolaus, that I agree is a good idea. The way I tried to make it more flexible is first of all transitioning to a ioctl(), as suggested by both Jann and Miklos, and by using a data structure with flexible array member. Thanks Amir for the fuse2 pointer. I didn't notice that project before, but I really enjoyed going through its code. I'm curious if it's intended to deprecate the current fuse implementation or is what the current fuse will converge to. I noticed that some good ideas that were in fuse2 have been also added to fuse, so I tried to take fuse2 as a reference for my passthrough ioctl(). Miklos, can you please give us a glimpse of what's the future of fuse2? Thanks a lot again for the feedback, I'll send the new patch in a few minutes. Cheers, Alessio On Mon, Aug 24, 2020 at 02:48:01PM +0200, Miklos Szeredi wrote: > On Wed, Aug 19, 2020 at 11:25 AM Amir Goldstein wrote: > > > > What I have in mind is things like not coupling the setup of the > > > passthrough fds to open(), but having a separate notification message for > > > this (like what we use for invalidation of cache), and adding not just > > > an "fd" field but also "offset" and "length" fields (which would > > > currently be required to be both zero to get the "full file" semantics). > > > > > > > You mean like this? > > > > https://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git/commit/?h=fuse2 > > Look specifically at fuse_file_map_iter(): > > https://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git/tree/fs/fuse2/file.c?h=fuse2#n582 > > and fudev_map_ioctl(): > > https://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git/tree/fs/fuse2/fudev.c?h=fuse2#n601 > > This avoids the security issue Jann mentioned as well as allowing > arbitrary mapping of file ranges. E.g. it could also be used by a > block based filesystem to map I/O directly into the block device. > > What the implementation lacks is any kind of caching. Since your > usecase involves just one map extent per file, special casing that > would be trivial. We can revisit general caching later. > > Thanks, > Miklos