Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp4546541rwr; Sun, 23 Apr 2023 07:52:40 -0700 (PDT) X-Google-Smtp-Source: AKy350YekNriy9HBNJoZZzUt1+p+AftcM7HBAByaJ95Pl9yELUH98YnHVa2RhKY9+q+zCwp6myRb X-Received: by 2002:a05:6a20:734e:b0:ef:e240:b559 with SMTP id v14-20020a056a20734e00b000efe240b559mr16124457pzc.46.1682261560697; Sun, 23 Apr 2023 07:52:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682261560; cv=none; d=google.com; s=arc-20160816; b=YwxLNR/+0w3itoL/0jpY4llCy7VjkU2K3Jm8neV2pEwx2fRRgxFfU5EnPd8OnJn5IL PDzqu4dQsari63MjqxFwWShBHWHrLFLUvOH5OECKZiTxNr47dgubfcQl+M2DC8EL/zqG sL7iWyU1rDciDqkbfh5FopasELYK8QMozE7khUi664vuEpylBGf+MSDZO15GkLj5Kh/X EAC4Rrq0k4jP7wnYYFKVsDO0IT8RlHy4tfi7zkE4Kz59EzvTJquoUMXExJvgxMQEp1iN yFSeycmyc0nX8iXayOPJL1cT0tbVGIm5WhayfgoP7WFcF0lslcCnD+dB3HGqmuIxrse+ Lu/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Byy5aNIeSbfDla4aJVVFrIzVSy2E3RHqITcEmVo7JRE=; b=HZ/SPyYSJrmEcT88r/n2tGwXdpHgjo8UWjA3mWWpbeocAmCwqYnAIFEb9b+8h/KoOi ArwZY/BRGuOGnHgG3YYfFbelxF0yvxbNGccHZ+0dL0PMKMTZcXq2yuyenRBu/2i9e5TY 87LVf0jVegTA3zXkiocp5i8q9IH2k4a0HobalW9PLp3rrwtlIA+KRT2ZxLcxc4aBXOVR LSxIraMND2pPFqHF1tYLiKQDNxPnygoVrjtR+H6KrgnhMRXfu/UxIlWh/U0FlE0v2VUw 4JJ0ueyiNWpwmyj3RFjR1AgdrWepuRQeepc+vJ1/6sawEe/GKp3SGdJ5NcYt9PyqlPCA viiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=RKBXXCzM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s62-20020a632c41000000b0051b618ec7d0si9787681pgs.617.2023.04.23.07.52.27; Sun, 23 Apr 2023 07:52:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=RKBXXCzM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230280AbjDWOvZ (ORCPT + 99 others); Sun, 23 Apr 2023 10:51:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230507AbjDWOvM (ORCPT ); Sun, 23 Apr 2023 10:51:12 -0400 Received: from mail-vs1-xe33.google.com (mail-vs1-xe33.google.com [IPv6:2607:f8b0:4864:20::e33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30C63271C; Sun, 23 Apr 2023 07:51:07 -0700 (PDT) Received: by mail-vs1-xe33.google.com with SMTP id ada2fe7eead31-42ff08ab61dso765420137.1; Sun, 23 Apr 2023 07:51:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682261466; x=1684853466; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Byy5aNIeSbfDla4aJVVFrIzVSy2E3RHqITcEmVo7JRE=; b=RKBXXCzMbPO0c3dNHN4kOwMb50a1vI21F46uM2qNrVGZnxlLgn6ryNiwH1XqALlyv7 mZQRQuTDmWR38qNqUA2rrHKP5Uhei0U8KHgtxj0lsz6a2FfEzm3+tYKroNLLgYxBiwKk MLD2rYfWu3b0phFlVaYGkcvgnIFD3jbaMYAPdk5rPRrdzAvXYf7mJJMJ4KGa34iDcPt4 5ox0VFI/dPyeyTAhwd0MFh3YbdadxiwI14v1BK4DXfxDmc0mcGoQDdBZXnXi4+2CrscN FyRRXhJW9V/P8Nb0SBdcjBCgwi04HqJfwI20sjH4UMKLdKUutDpCdU1VvKebky04iNnp P9hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682261466; x=1684853466; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Byy5aNIeSbfDla4aJVVFrIzVSy2E3RHqITcEmVo7JRE=; b=GzX2wnZG97WGdB1le7spxvoebd1vJqz9duV/KV+vBz6YU0+OYg+eTUSBpGYixvBwAQ A2ukyAt/8/yvW06Rm1+vRIlYFwtxC+/xSl+/gfSJHcdCYEYRwp6ko4laz+cnKuyibza4 cCeJF8NwTckjEhzIDHI1HgnNvnbT8NSvQ+6ew95L124ch4WLugOwFSZRwiKSm156JJAa CPZ1ADB3vEAPWcCkWo0FPQZlEVShSg/XbOXeiFU72bzlLbOnYoExAAG2wHyJaCVjSEiK ir9zJYhB7FQ/HuQfpGw/xsq/NSNFmhGeL9GPeyeug/kH25pTeJbl3v7xdEOxP2BIlwpw /m6w== X-Gm-Message-State: AAQBX9ds2/4kjJ7PTkuRS51NclIssKzjw6znnCCVBEMafEsxNJsSPKma v7l+6Mg+6KZBhPVKXSAdx9I1bJq8QCkmKKVo950= X-Received: by 2002:a67:fe97:0:b0:430:23c2:1c05 with SMTP id b23-20020a67fe97000000b0043023c21c05mr4275621vsr.4.1682261466002; Sun, 23 Apr 2023 07:51:06 -0700 (PDT) MIME-Version: 1.0 References: <20230418014037.2412394-1-drosen@google.com> In-Reply-To: From: Amir Goldstein Date: Sun, 23 Apr 2023 17:50:53 +0300 Message-ID: Subject: Re: [RFC PATCH bpf-next v3 00/37] FUSE BPF: A Stacked Filesystem Extension for FUSE To: Daniel Rosenberg Cc: Miklos Szeredi , bpf@vger.kernel.org, Alexei Starovoitov , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org, Daniel Borkmann , John Fastabend , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Shuah Khan , Jonathan Corbet , Joanne Koong , Mykola Lysenko , kernel-team@android.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 21, 2023 at 4:41=E2=80=AFAM Daniel Rosenberg wrote: > > On Mon, Apr 17, 2023 at 10:33=E2=80=AFPM Amir Goldstein wrote: > > > > > > Which brings me to my biggest concern. > > I still do not see how these patches replace Allesio's > > FUSE_DEV_IOC_PASSTHROUGH_OPEN patches. > > > > Is the idea here that ioctl needs to be done at FUSE_LOOKUP > > instead or in addition to the ioctl on FUSE_OPEN to setup the > > read/write passthrough on the backing file? > > > > In these patches, the fuse daemon responds to the lookup request via > an ioctl, essentially in the same way it would have to the /dev/fuse > node. It just flags the write as coming from an ioctl and calls > fuse_dev_do_write. An additional block in the lookup response gives > the backing file and what bpf_ops to use. The main difference is that > fuse-bpf uses backing inodes, while passthrough uses a file. Ah right. I wonder if there is benefit in both APIs or if backing inode is sufficient to impelelent everything the could be interesting to implemen= t with a backing file. > Fuse-bpf's read/write support currently isn't complete, but it does > allow for direct passthrough. You could set ops to default to > userspace in every case that Allesio's passthrough code does and it > should have about the same effect. What are the subtle differences then? > With the struct_op change, I did > notice that doing something like that is more annoying, and am > planning to add a default op which only takes the meta info and runs > if the opcode specific op is not present. > Sounds interesting. I'll wait to see what you propose. > > > I am missing things like the FILESYSTEM_MAX_STACK_DEPTH check that > > was added as a result of review on Allesio's patches. > > > > I'd definitely want to fix any issues that were fixed there. There's a > lot of common code between fuse-bpf and fuse passthrough, so many of > the suggestions there will apply here. > That's why I suggested trying to implement the passthough file ioctl functionality first to make sure that none of the review comments in the first round were missed. But if we need functionality of both ioctls, we can collaborate the work on merging them separately. > > The reason I am concerned about this is that we are using the > > FUSE_DEV_IOC_PASSTHROUGH_OPEN patches and I would like > > to upstream their functionality sooner rather than later. > > These patches have already been running in production for a while > > I believe that they are running in Android as well and there is value > > in upsteaming well tested patches. > > > > The API does not need to stay FUSE_DEV_IOC_PASSTHROUGH_OPEN > > it should be an API that is extendable to FUSE-BPF, but it would be > > useful if the read/write passthrough could be the goal for first merge. > > > > Does any of this make sense to you? > > Can you draw a roadmap for merging FUSE-BPF that starts with > > a first (hopefully short term) phase that adds the read/write passthrou= gh > > functionality? > > > > I can help with review and testing of that part if needed. > > I was planning to discuss this with you on LSFMM anyway, > > but better start the discussion beforehand. > > > > Thanks, > > Amir. > > We've been using an earlier version of fuse-bpf on Android, closer to > the V1 patches. They fit our current needs but don't cover everything > we intend to. The V3 patches switch to a new style of bpf program, > which I'm hoping to get some feedback on before I spend too much time > fixing up the details. The backing calls themselves can be reviewed > separately from that though. > > Without bpf, we're essentially enabling complete passthrough at a > directory or file. By default, once you set a backing file fuse-bpf > calls by the backing filesystem by default, with no additional > userspace interaction apart from if an installed bpf program says > otherwise. If we had some commands without others, we'd have behavior > changes as we introduce support for additional calls. We'd need a way > to set default behavior. Perhaps something like a u64 flag field > extension in FUSE_INIT for indicating which opcodes support backing, > and a response for what those should default to doing. If there's a > bpf_op present for a given opcode, it would be able to override that > default. If we had something like that, we'd be able to add support > for a subset of opcodes in a sensible way. So maybe this is something to consider. Thanks, Amir.