Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp4755724rwe; Mon, 17 Apr 2023 18:43:11 -0700 (PDT) X-Google-Smtp-Source: AKy350aUolWh0q2h3QSId9ItTaSajggVUTrnHzv/sX4cLGMPWCjEz4P3Ugsx5wtoAyAPBLGAIo9Y X-Received: by 2002:a05:6a00:1695:b0:63a:5bcd:e580 with SMTP id k21-20020a056a00169500b0063a5bcde580mr23759394pfc.9.1681782191528; Mon, 17 Apr 2023 18:43:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681782191; cv=none; d=google.com; s=arc-20160816; b=ZdiuvAXpj5+qnGoiq2hmtBGtvswMxgpvoA8vzPe63TqlX5tSQAq/irFZAWZ/3TdexE fkxoBrrK8m0Mrj6FRnUqmxrjFO8fL73jje+7hFapdg4vGdkhXWOH7EA30MPWhlqhf7Z4 k4ryNRalcahyak6K0amUs60m7CyjH66maw7gawW84w4a3VSveH/gCcLN1MbYtqa35dh6 XK0Qbd3AI8KMdrjWno+6fu0dOrsNPkEJdPf8Rz9IRcDU2As/UDRUU3FPh4SezpcJfPvb 9K1rkklno4ZVVulV3PqcElLM8J6N3MoXb7sZTG+L0cCzu6JZgp4mDvqEFisrIzXLgCGt WYtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=k+WSpIn3NUEIdVcNWDxlTZBL9IhEMs5qHwjDTSF5QyA=; b=T1zGbf+QnGDbSlnJIFAq8bwKuzwly34yBgZUQ5vMrNpaUirlYoqbLm4gRYrx54dtfw K9+7XVd9Xu4NOzMDCkkj6dvTAti3e2n6BJu44CHjLKkeGnjDTGmvBzfy2H4vGQtPEyeY yDzV47oiOQhB3KlSZUcaRWSMby08MDo/8+XHo2c4jf/W6ti8QvGrVtnN/0CJh6c///LR uLJnbi3JaszASqCCsE6doXD0ZOCvsLRO1Lz9FldqESuEyTgtGN4qG7N6IkB2YPK83hXi D0YIzqpk7ILxGUfgOVBTj1JUUGC5Pd+TFzvOfzdw/vcZoVw8KC46J9wPktfO0EG7mnFW x7+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=gnEAvtWY; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p11-20020aa79e8b000000b0063b8695da40si6349751pfq.238.2023.04.17.18.42.55; Mon, 17 Apr 2023 18:43:11 -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=@google.com header.s=20221208 header.b=gnEAvtWY; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230465AbjDRBmb (ORCPT + 99 others); Mon, 17 Apr 2023 21:42:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230253AbjDRBlp (ORCPT ); Mon, 17 Apr 2023 21:41:45 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 621416EBD for ; Mon, 17 Apr 2023 18:41:14 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id 188-20020a2504c5000000b00b8f6f5dca5dso8197857ybe.7 for ; Mon, 17 Apr 2023 18:41:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1681782073; x=1684374073; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=k+WSpIn3NUEIdVcNWDxlTZBL9IhEMs5qHwjDTSF5QyA=; b=gnEAvtWYbBPrlRDvmMhwWHAU4VOPAZNhzEbReBa4tJPpc5X3cQyQnOkcj+IZxU+jtd Q+YCDhkPu6ZImWiqrO7KC2hZnhfm/LoPf2Qk+B0v/m+gmZs6ydm6J9MF3xNYweVlnDD8 kzJrv+qZegriRdHZmr6G27dsKx70i7W4bP34J1/ZwAQen87rca+5p+yPyWMoLaX9Dau9 nVVsiKpQ1gJzqgxY8b3BMTPSECOFqN5iCxmNf5WcJMJVHe+OKuTEuYOpIO0xE/kXViUv CKddSMZuirEzlq3i+5fDaLh4bYaIBJcIpoMpmtH8zmyBRsHn6nqpB1ZlzCdIk6aTFlgp Gt8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681782073; x=1684374073; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=k+WSpIn3NUEIdVcNWDxlTZBL9IhEMs5qHwjDTSF5QyA=; b=PgHZJomjTqVBKxl9P8viDVYy1RVNc1wmmzf0WJrmmd2ZjXXGQ9Y5/EaBM+Gg7PJPze 824rWdUImBbGFBI38bki0utX6GyHtyPorAVc1xpftHvD6cowOp1EAqKyNuVPR+Ft0Nf5 9X2okA6rZvpykAn0kzckSx/7HqJq5GgG4dISvOIuJa/hty5w3J6tWZBtujc2/epyk+pD WIaLklE6GqCHvzrCfgHfo+uV/CkYJ4gCc9D94fgGD5mvCmyRa1DJQa2nO6WI84A3oVF+ F9vKihFPM7IWqPCF3DfKTtsZRCuBJg3CLbIVxPl71j0UD2mbXi1K1/CknMdHvbpVh0rP yfAg== X-Gm-Message-State: AAQBX9cLZWuPDUAXdoo0ywAzQANVL0az8+GCenmaDx7YZ9fby2hVCwx5 EBiPki2rZ3a8ZdsYg7HrHkl9i1qGeMs= X-Received: from drosen.mtv.corp.google.com ([2620:15c:211:201:e67a:98b0:942d:86aa]) (user=drosen job=sendgmr) by 2002:a25:cfcc:0:b0:b78:1b26:a642 with SMTP id f195-20020a25cfcc000000b00b781b26a642mr8808364ybg.1.1681782073411; Mon, 17 Apr 2023 18:41:13 -0700 (PDT) Date: Mon, 17 Apr 2023 18:40:10 -0700 In-Reply-To: <20230418014037.2412394-1-drosen@google.com> Mime-Version: 1.0 References: <20230418014037.2412394-1-drosen@google.com> X-Mailer: git-send-email 2.40.0.634.g4ca3ef3211-goog Message-ID: <20230418014037.2412394-11-drosen@google.com> Subject: [RFC PATCH v3 10/37] fuse-bpf: Don't support export_operations From: Daniel Rosenberg To: Miklos Szeredi , bpf@vger.kernel.org, Alexei Starovoitov Cc: Amir Goldstein , 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, Daniel Rosenberg Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=unavailable 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 In the future, we may choose to support these, but it poses some challenges. In order to create a disconnected dentry/inode, we'll need to encode the mountpoint and bpf into the file_handle, which means we'd need a stable representation of them. This also won't hold up to cases where the bpf is not stateless. One possibility is registering bpf programs and mounts in a specific order, so they can be assigned consistent ids we can use in the file_handle. We can defer to the lower filesystem for the lower inode's representation in the file_handle. Signed-off-by: Daniel Rosenberg --- fs/fuse/inode.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index b71e8758fab5..fe80984f099a 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -1107,6 +1107,14 @@ static int fuse_encode_fh(struct inode *inode, u32 *fh, int *max_len, nodeid = get_fuse_inode(inode)->nodeid; generation = inode->i_generation; +#ifdef CONFIG_FUSE_BPF + /* TODO: Does it make sense to support this in some cases? */ + if (!nodeid && get_fuse_inode(inode)->backing_inode) { + *max_len = 0; + return FILEID_INVALID; + } +#endif + fh[0] = (u32)(nodeid >> 32); fh[1] = (u32)(nodeid & 0xffffffff); fh[2] = generation; -- 2.40.0.634.g4ca3ef3211-goog