From patchwork Tue Nov 22 02:15:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Rosenberg X-Patchwork-Id: 24124 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1956553wrr; Mon, 21 Nov 2022 18:18:29 -0800 (PST) X-Google-Smtp-Source: AA0mqf6LRVdrQ8Kli504Y7vNA2+HyWtXYwVZlAHSzjntV42YJtcRJQK6ztJ9Eu5soodl0ZVwkbnD X-Received: by 2002:a17:902:d650:b0:189:f86:ecb with SMTP id y16-20020a170902d65000b001890f860ecbmr12613978plh.45.1669083509105; Mon, 21 Nov 2022 18:18:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669083509; cv=none; d=google.com; s=arc-20160816; b=BZMmUdgXXtiRyRhpVlrBsYLtw0oJUNcduOAnRprMjHZT6BL6RrAD9qRW6cPkURyiE0 wsRhxZRJKVNtOHQzVoLHzVWapE2sAjv9MSA5b72ePWWfMR6qiJPHaNzqXxHMDM8FZ+YE cSdrB/0DuQtVOb8cGqwqLJljXYIiibM/LEvW1ugRuPoudk2I2bpV4TFGZ9l+Csd0oGYd QdlnRZcmGT/iYz8jjIns1N5ttMX8YBxLzMm8TcQjoL8wOpfLGAFMU0X6yYk9m3VH3iB3 RrF9OiNOHQ7Q4+eZUF8t0B2nCSWpwHvG8i9M3R6ZQnDvVa+IGLP/qOpf9zCFn8Y7/IeV RWgQ== 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=J0kBTpGRrZ4fbYeP7Bh1hsOct+NKdkC7fVmp/4th4/s=; b=LexwqGDaTix/wa64h1tZYC1S1XAoaroGJGEPlEHY9Lot6kdSsX7TgHbQhx6aWiuYAi 9PNUvwXpmYjISkmkHb8eBmafwLUNrHRg3+hwVEhnQyev9FtNbliHegAeq37S0kt3uqit XitnLmjDKJZusDuQWcVGrhlpVj5j01beSM4DS2AwjJo2lKECQVT1gEb7SWHNCpbzAP5m F26sPIq4dYffwMvMPVZ+mt9JXOYlvs+eWOQtuzz6+qa61Taze9Fj622xdck0CGekNBCB P8fznEIoixgQ/HKRQQ5wlLhEEOv6a7/fz/kr/r50OUB+w/NP+QKM+ZdIeX3BRa8GNXje c0Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=PTyyzqK8; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l6-20020a170902ec0600b00186e34524besi12019912pld.522.2022.11.21.18.18.16; Mon, 21 Nov 2022 18:18:29 -0800 (PST) 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=20210112 header.b=PTyyzqK8; 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 S231928AbiKVCQt (ORCPT + 99 others); Mon, 21 Nov 2022 21:16:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232552AbiKVCQe (ORCPT ); Mon, 21 Nov 2022 21:16:34 -0500 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C37A5E634D for ; Mon, 21 Nov 2022 18:16:08 -0800 (PST) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-36810cfa61fso127414127b3.6 for ; Mon, 21 Nov 2022 18:16:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=J0kBTpGRrZ4fbYeP7Bh1hsOct+NKdkC7fVmp/4th4/s=; b=PTyyzqK8VIpYcc3Jnv1HwKlTZVtN825+P2qskFJugJ/DNoyLCfdNJgvvb4WK//Litx 9PSdHS+fDIZijxFoVEzf+iNQufz0lxZloF1cOdSlQxtrE3mGt+L7NNZ7cAq+QY79+G+5 qDhW62Uexhw5NGJYa+8of89/EQtHfE3nO8G2fOeaWQ4CRwdC6fVqUCyjN41ZDHRvzP0e 1D4semdRyxKDsXvvOZn8BhhTnael1tURdERVZKJGOgEYACViGTrodjUlJBmnKctQGZd1 WHhMCxTizWOZtXg3xr0jXG4k/8eB3tTqtQsiIsWRi9nQDHQUvHOz09sNxIWD/ti3qwf2 kzFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=J0kBTpGRrZ4fbYeP7Bh1hsOct+NKdkC7fVmp/4th4/s=; b=Kt6DAr5TrS3ZXa5pZ2EhJ+WQlXhbSBUh5d1u1lqtYY9NcGPEMHLJo/U+jYPMm8OY9Q Ud6DGZrUgmjk8oAu/n0vdKF6Lc607DubGLR75TCuIuAPqLEwCfZcek6jydSzomuB3W/p thCNT7NahyOoZIp+WsHcJu0ZyL7fWX/FiadQSFcuulkhy5wvUsBo116b3+ojd8UaLYWg b9YvI4YRTeAjQndRkb88C0k7jz4wEs3UVMejFC1KKto5UJjcxsxGiKJxiAei2Lq276Z6 rd/XojFWVSqGFXLsd1YP4LFGhshGS/2lGmcOH3tPv/1g0TJQ0+YWvP5S1ZOorJEdXJKC QpmA== X-Gm-Message-State: ANoB5pmTgaHHf+cs9bFBrbxp5WjxcRmo7veobc3gav7UUwc5MEqvcNAb K5wLtOVRIa/ES3pOtAb36PbVa5mZWeI= X-Received: from drosen.mtv.corp.google.com ([2620:15c:211:200:8539:aadd:13be:6e82]) (user=drosen job=sendgmr) by 2002:a05:6902:118e:b0:6e7:f54:b3d6 with SMTP id m14-20020a056902118e00b006e70f54b3d6mr4166933ybu.577.1669083368110; Mon, 21 Nov 2022 18:16:08 -0800 (PST) Date: Mon, 21 Nov 2022 18:15:21 -0800 In-Reply-To: <20221122021536.1629178-1-drosen@google.com> Mime-Version: 1.0 References: <20221122021536.1629178-1-drosen@google.com> X-Mailer: git-send-email 2.38.1.584.g0f3c55d4c2-goog Message-ID: <20221122021536.1629178-7-drosen@google.com> Subject: [RFC PATCH v2 06/21] fuse-bpf: Don't support export_operations From: Daniel Rosenberg To: Miklos Szeredi Cc: Amir Goldstein , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org, bpf@vger.kernel.org, kernel-team@android.com, Daniel Rosenberg 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,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750160909372288550?= X-GMAIL-MSGID: =?utf-8?q?1750160909372288550?= 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 224d7dfe754d..bafb2832627d 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -1100,6 +1100,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;