Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp692432iob; Wed, 18 May 2022 10:45:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDiLhRbxRWli41msdK70fqxF2oXpVepfZ8X65EKCOdSqGeiwJtOmv/F1g1xvOgmlziw7dL X-Received: by 2002:a17:903:264f:b0:161:39ef:57ee with SMTP id je15-20020a170903264f00b0016139ef57eemr714823plb.60.1652895900661; Wed, 18 May 2022 10:45:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652895900; cv=none; d=google.com; s=arc-20160816; b=0VLtO8669rGGjIk4v7jhzc3rHKEdu2WHakDb4qCOFYTLs3OlH6fAio4OIMeNQ0uupz QamrilHsuR/IJ5g96pPqZYxMS4pMvUsH19/PgYu6nf69peMlcwrSjFReg0QjnZjHZjYl vW1Ux5ROFYxmRNsWKabKKOek/fqqVbVueZl+z/03aCCHvMPWIpXRnenBDEGJrs5+A8eB MmpiV1xk4NfdGHpu0rNoGgDoYhPAhQDpno43Gao6CfXqHNXfeMBRxUlrcA+SUgGEgnSS r3zhd0sDO5YqZqYS11RnIpskYM/63tXnDgw5iKeuBcoeBaBeJDTuAI9nKGH58sdqs2zt bIJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Dzen8Tfphka+V9v1rHHzLeFthFMVB9wbjOwentfjkpk=; b=GGcYXj9061oVpx1OH3OB4+P2s+tVyRGLhIx2x7o3BBLmnIXl7jMYKvqImseUriuH4f 91Kn4PYkjJlcwrl4hd7qPe5YPmzQyqluaaahXcQowWlFl2lrNGbAqYNzTPhJ2HMhN4Dm wYEDn6JO7Ho80J5zJeZr6eqoE22Ltr1we4Bt1YY1NYjLMj0TIEtnGwJZxoZKgUye0bJp 1GaxH5XoZyg61EJbrO5PXmjax9jw4QYapLHaxJ0vxq6COrCG7ZmJEALap+1x7y9dNs+s xuwmoEKCyozyF8x3kYhQGWvNfSs513+4LKW37rIzvX8DJkMWfwGMSEtGKIbVwoSqoV4L AHNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="b6v/Ku5v"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id a63-20020a624d42000000b0050dcf85b9e1si3860890pfb.141.2022.05.18.10.44.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 10:45:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="b6v/Ku5v"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AC7B4218FED; Wed, 18 May 2022 10:44:58 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241197AbiERRom (ORCPT + 99 others); Wed, 18 May 2022 13:44:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241077AbiERRom (ORCPT ); Wed, 18 May 2022 13:44:42 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1887F69B43 for ; Wed, 18 May 2022 10:44:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652895880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Dzen8Tfphka+V9v1rHHzLeFthFMVB9wbjOwentfjkpk=; b=b6v/Ku5vefSiHCUKyn9BLFjvA5wboI9knYphU2asZsrEbLNaonk4piKtMl4qYk4G/NJBLB Y1FsPA8zdjFTFNfA064l0NIMrWqBQJGb07SghDQ9nLvW91un78+XWAhx8TLJZSLtaqYsXX IN5jc4VdxP2hh0+ip2JbR+X8MA7WU2Y= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-296-tP__qQLGPtai9qnYDgv2xQ-1; Wed, 18 May 2022 13:44:35 -0400 X-MC-Unique: tP__qQLGPtai9qnYDgv2xQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5567B811E78; Wed, 18 May 2022 17:44:35 +0000 (UTC) Received: from horse.redhat.com (unknown [10.22.16.154]) by smtp.corp.redhat.com (Postfix) with ESMTP id 476FC2026D6A; Wed, 18 May 2022 17:44:35 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id 0949F2208FA; Wed, 18 May 2022 13:44:35 -0400 (EDT) Date: Wed, 18 May 2022 13:44:34 -0400 From: Vivek Goyal To: Dharmendra Singh Cc: miklos@szeredi.hu, linux-fsdevel@vger.kernel.org, fuse-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, bschubert@ddn.com, Dharmendra Singh Subject: Re: [PATCH v5 1/3] FUSE: Avoid lookups in fuse create Message-ID: References: <20220517100744.26849-1-dharamhans87@gmail.com> <20220517100744.26849-2-dharamhans87@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Wed, May 18, 2022 at 01:41:02PM -0400, Vivek Goyal wrote: > On Tue, May 17, 2022 at 03:37:42PM +0530, Dharmendra Singh wrote: > > [..] > > diff --git a/include/uapi/linux/fuse.h b/include/uapi/linux/fuse.h > > index d6ccee961891..bebe4be3f1cb 100644 > > --- a/include/uapi/linux/fuse.h > > +++ b/include/uapi/linux/fuse.h > > @@ -301,6 +301,7 @@ struct fuse_file_lock { > > * FOPEN_CACHE_DIR: allow caching this directory > > * FOPEN_STREAM: the file is stream-like (no file position at all) > > * FOPEN_NOFLUSH: don't flush data cache on close (unless FUSE_WRITEBACK_CACHE) > > + * FOPEN_FILE_CREATED: the file was actually created > > */ > > #define FOPEN_DIRECT_IO (1 << 0) > > #define FOPEN_KEEP_CACHE (1 << 1) > > @@ -308,6 +309,7 @@ struct fuse_file_lock { > > #define FOPEN_CACHE_DIR (1 << 3) > > #define FOPEN_STREAM (1 << 4) > > #define FOPEN_NOFLUSH (1 << 5) > > +#define FOPEN_FILE_CREATED (1 << 6) > > > > /** > > * INIT request/reply flags > > @@ -537,6 +539,7 @@ enum fuse_opcode { > > FUSE_SETUPMAPPING = 48, > > FUSE_REMOVEMAPPING = 49, > > FUSE_SYNCFS = 50, > > + FUSE_CREATE_EXT = 51, > > I am wondering if we really have to introduce a new opcode for this. Both > FUSE_CREATE and FUSE_CREATE_EXT prepare and send fuse_create_in{} and > expect fuse_entry_out and fuse_open_out in response. So no new structures > are being added. Only thing FUSE_CREATE_EXT does extra is that it also > reports back whether file was actually created or not. > > May be instead of adding an new fuse_opcode, we could simply add a > new flag which we send in fuse_create_in and that reqeusts to report > if file was created or not. This is along the lines of > FUSE_OPEN_KILL_SUIDGID. > > So say, a new flag FUSE_OPEN_REPORT_CREATE flag. Which we will set in > fuse_create_in->open_flags. If file server sees this flag is set, it > knows that it needs to set FOPEN_FILE_CREATED flag in response. > > To me creating a new flag FUSE_OPEN_REPORT_CREATE seems better instead > of adding a new opcode. Actually I take that back. If we were to use a flag, then we will have to do feature negotiation in advance at init time and only then we can set FUSE_OPEN_REPORT_CREATE. But we are relying on no new feature bit instead -ENOSYS will be returned if server does not support FUSE_CREATE_EXT. So adding a new opcode is better. Thanks Vivek