Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp717173rwd; Thu, 1 Jun 2023 05:49:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6Vs9goZwv5MR7Z59yrGS8M7f1zl1egPYk6eG/TDnHetVKiHIV/Owt7m19jZClwmD4aV7AY X-Received: by 2002:a05:6358:2812:b0:123:52c7:d5b3 with SMTP id k18-20020a056358281200b0012352c7d5b3mr4237515rwb.12.1685623773771; Thu, 01 Jun 2023 05:49:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685623773; cv=none; d=google.com; s=arc-20160816; b=lEVDy0h99hWck0e28z4T8Ba8b6QGvCNjNCUdEdj18l/hd+KYIvU+7eE1Xopxb+G3Ac ZzWX1nd7rh4vRilHMoshgjk8sdZe0qktKmV+GrJals1k3lRX0aquzCBBel9LOobp4Lrt lnfkTI+iBnqa20SkQkMf5TovDwXaDgOr0NJgFNjiuZiWGEKOPOieZaDJ0x6ot+Xo8fYN T2bw2gjCldp5K9ypttlJlWaiEqCWSwsGEYvIQ10tDzxmafkJuGDM8KkefKrTCP21drQl RtIe64BlmMOnMn6R3Rk0dHX5COrFAV9Q271S4zEhiq7MMg7/b3v+u8n996nUfzp9Dzq6 OkYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=6TjKKwQ7YZ52K1F/sXvcot46oThTtzilfqhAodws70s=; b=JKl4XMk16uVxtk3/VXAsoRDWW4r15eerHlcG/NBkZfE/JRW5J8D/TDYvRxLFRtYRAn gk6GSTEZKEr0Bz7zUd/B0KThEM5Ffh6iLjoC3o9Av40AHLtchhZfKNmKud3ZUGGPkgjW iHhfWgXxwMHn4KFwegSloL+FZwsQ9Wm3m2veOIC+YAzHEq7kIps8Yde9gBpPKOa9uORb +xqrWMGiUyNC4nlOE9ptGyAkJmylbp39dpH605OFWyofNuyZEe4sS4v9PkQTE0k3/Jid ayEEkR2rjfOYbbFo9IMVkT/V0Apz/3lJOekn4Xsisz46F2gqeCxOxOOerhh4ZFlVPPYE vjTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@szeredi.hu header.s=google header.b=CsDnRRS5; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=szeredi.hu Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h15-20020a63384f000000b0053f2524532csi2788061pgn.310.2023.06.01.05.49.22; Thu, 01 Jun 2023 05:49:33 -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=@szeredi.hu header.s=google header.b=CsDnRRS5; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=szeredi.hu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232820AbjFAMSc (ORCPT + 99 others); Thu, 1 Jun 2023 08:18:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231970AbjFAMSb (ORCPT ); Thu, 1 Jun 2023 08:18:31 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED0109D for ; Thu, 1 Jun 2023 05:18:29 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-96f7bf29550so102770366b.3 for ; Thu, 01 Jun 2023 05:18:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; t=1685621908; x=1688213908; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=6TjKKwQ7YZ52K1F/sXvcot46oThTtzilfqhAodws70s=; b=CsDnRRS5uBym/ALZvCHGm7OVO8VYPXC64GNn1FNTOnKgg5jOg+iOXhAtG66CKfdOd+ UPXHtlKvdlXjgSlLL+BM5UOjTJVvXB3W3bNTbmPXlP/wSVxZXEPl4s/zZG20uM6c54SO gm6uJ0Ltny7bOCl5S+z77XWhByJWJjWtyW9yg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685621908; x=1688213908; h=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=6TjKKwQ7YZ52K1F/sXvcot46oThTtzilfqhAodws70s=; b=FdP42fOgJNMsE86dCylqAJJ12T42sygLWapE0EQhGDuCfu+4pP+erEv04q4Pvqqr1N w+IgjOyyf81O7dkZvqfcbqaCnog8sYS7RTlqA0ZKuVKhITYp1PkLg0AYSJQUFXJ9T2Qu lyn+xifczy3pUCEh9nbQK5CRYlPa8BKpRHJijA//HhLM2diY/ULOPEUDG4AF7DV7sBfO WoZO1I0qlhQaGe6z1lKcg7CsGGjxRMOri2ChU1nOkHApw2axcLIBC87+MVDJ4i8ytKVR TysLbm8uMK2JH44wgt/dfCmlnBEqzRNUa5STtXe3l80yEzDDR5jvQF4k8TBuGAbNKuYQ ua1A== X-Gm-Message-State: AC+VfDzfHdKc4MGkG7QV9Fs1HHbp1ynWt+3h9rNsOHpN1AgUifiaA0Sc GaA9eu4nhODmDc/I1S4LVH5hA3h6pzqSOrJMBCUO0Q== X-Received: by 2002:a17:907:6e09:b0:973:eac4:a24d with SMTP id sd9-20020a1709076e0900b00973eac4a24dmr7988792ejc.57.1685621908409; Thu, 01 Jun 2023 05:18:28 -0700 (PDT) MIME-Version: 1.0 References: <20220517100744.26849-1-dharamhans87@gmail.com> <805d122a-34d0-b097-c3e3-f3cc7c95aa46@ddn.com> In-Reply-To: <805d122a-34d0-b097-c3e3-f3cc7c95aa46@ddn.com> From: Miklos Szeredi Date: Thu, 1 Jun 2023 14:18:17 +0200 Message-ID: Subject: Re: [PATCH v5 0/3] FUSE: Implement atomic lookup + open/create To: Bernd Schubert Cc: Dharmendra Singh , Vivek Goyal , "linux-fsdevel@vger.kernel.org" , fuse-devel , "linux-kernel@vger.kernel.org" , Horst Birthelmer Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 Thu, 1 Jun 2023 at 14:01, Bernd Schubert wrote: > > On 6/1/23 13:50, Miklos Szeredi wrote: > > On Thu, 1 Jun 2023 at 13:17, Bernd Schubert wrote: > >> > >> Hi Miklos, > >> > >> On 5/19/22 11:39, Miklos Szeredi wrote: > >>> On Tue, 17 May 2022 at 12:08, Dharmendra Singh wrote: > >>>> > >>>> In FUSE, as of now, uncached lookups are expensive over the wire. > >>>> E.g additional latencies and stressing (meta data) servers from > >>>> thousands of clients. These lookup calls possibly can be avoided > >>>> in some cases. Incoming three patches address this issue. > >>>> > >>>> > >>>> Fist patch handles the case where we are creating a file with O_CREAT. > >>>> Before we go for file creation, we do a lookup on the file which is most > >>>> likely non-existent. After this lookup is done, we again go into libfuse > >>>> to create file. Such lookups where file is most likely non-existent, can > >>>> be avoided. > >>> > >>> I'd really like to see a bit wider picture... > >>> > >>> We have several cases, first of all let's look at plain O_CREAT > >>> without O_EXCL (assume that there were no changes since the last > >>> lookup for simplicity): > >>> > >>> [not cached, negative] > >>> ->atomic_open() > >>> LOOKUP > >>> CREATE > >>> > >> > >> [...] > >> > >>> [not cached] > >>> ->atomic_open() > >>> OPEN_ATOMIC > >> > >> new patch version is eventually going through xfstests (and it finds > >> some issues), but I have a question about wording here. Why > >> "OPEN_ATOMIC" and not "ATOMIC_OPEN". Based on your comment @Dharmendra > >> renamed all functions and this fuse op "open atomic" instead of "atomic > >> open" - for my non native English this sounds rather weird. At best it > >> should be "open atomically"? > > > > FUSE_OPEN_ATOMIC is a specialization of FUSE_OPEN. Does that explain > > my thinking? > > Yeah, just the vfs function is also called atomic_open. We now have > > > static int fuse_atomic_open(struct inode *dir, struct dentry *entry, > struct file *file, unsigned flags, > umode_t mode) > { > struct fuse_conn *fc = get_fuse_conn(dir); > > if (fc->no_open_atomic) > return fuse_open_nonatomic(dir, entry, file, flags, mode); > else > return fuse_open_atomic(dir, entry, file, flags, mode); > } > > > Personally I would use something like _fuse_atomic_open() and > fuse_create_open() (instead of fuse_open_nonatomic). The order of "open > atomic" also made it into libfuse and comments - it just sounds a bit > weird ;) I have to live with it, if you prefer it like this. I'd prefer FUSE_OPEN_ATOMIC for the API, but I don't care about function names, as long as the purpose is clear. Thanks, Miklos