public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bernd Schubert <bschubert@ddn.com>
To: Vivek Goyal <vgoyal@redhat.com>,
	Dharmendra Singh <dharamhans87@gmail.com>
Cc: miklos@szeredi.hu, linux-fsdevel@vger.kernel.org,
	fuse-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org,
	Dharmendra Singh <dsingh@ddn.com>
Subject: Re: [PATCH v5 1/3] FUSE: Avoid lookups in fuse create
Date: Wed, 18 May 2022 22:28:33 +0200	[thread overview]
Message-ID: <b8334bd4-8d24-1afa-8809-9b499dd357ea@ddn.com> (raw)
In-Reply-To: <YoUwgoAHiywYzvpK@redhat.com>



On 5/18/22 19:44, Vivek Goyal wrote:
> 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.

I guess it might work, if a flag is set and also returned (I would then 
call it FUSE_CREATE_EXT) - user space creat would need to set 
FOPEN_FILE_CREATED and that new flag. I just doubt that it simplifies 
things.

Btw, thanks a lot for your thorough reviews! Much appreciated.


Thanks,
Bernd

  reply	other threads:[~2022-05-18 20:28 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-17 10:07 [PATCH v5 0/3] FUSE: Implement atomic lookup + open/create Dharmendra Singh
2022-05-17 10:07 ` [PATCH v5 1/3] FUSE: Avoid lookups in fuse create Dharmendra Singh
2022-05-17 21:21   ` Vivek Goyal
2022-05-18 17:41   ` Vivek Goyal
2022-05-18 17:44     ` Vivek Goyal
2022-05-18 20:28       ` Bernd Schubert [this message]
2022-05-17 10:07 ` [PATCH v5 2/3] FUSE: Rename fuse_create_open() to fuse_atomic_common() Dharmendra Singh
2022-05-17 10:07 ` [PATCH v5 3/3] FUSE: Implement atomic lookup + open Dharmendra Singh
2022-05-19  9:39 ` [PATCH v5 0/3] FUSE: Implement atomic lookup + open/create Miklos Szeredi
2022-05-19 13:13   ` Miklos Szeredi
2022-05-19 17:41   ` Bernd Schubert
2022-05-19 18:16     ` Miklos Szeredi
2022-05-19 20:47       ` [fuse-devel] " Bernd Schubert
2022-05-19 19:33   ` Vivek Goyal
2023-06-01 11:16   ` Bernd Schubert
2023-06-01 11:50     ` Miklos Szeredi
2023-06-01 12:01       ` Bernd Schubert
2023-06-01 12:18         ` Miklos Szeredi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b8334bd4-8d24-1afa-8809-9b499dd357ea@ddn.com \
    --to=bschubert@ddn.com \
    --cc=dharamhans87@gmail.com \
    --cc=dsingh@ddn.com \
    --cc=fuse-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=vgoyal@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox