linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: Bernd Schubert <bschubert@ddn.com>,
	linux-fsdevel@vger.kernel.org, dsingh@ddn.com
Subject: Re: [PATCH v2 4/5] fuse: prepare for failing open response
Date: Thu, 1 Feb 2024 12:16:12 +0200	[thread overview]
Message-ID: <CAOQ4uxgv67njK9CvbUfdqF8WV_cFzrnaHdPB6-qiQuKNEDvvwA@mail.gmail.com> (raw)
In-Reply-To: <CAJfpeguF0ENfGJHYH5Q5o4gMZu96jjB4Ax4Q2+78DEP3jBrxCQ@mail.gmail.com>

On Thu, Feb 1, 2024 at 11:23 AM Miklos Szeredi <miklos@szeredi.hu> wrote:
>
> On Thu, 1 Feb 2024 at 00:09, Bernd Schubert <bschubert@ddn.com> wrote:
> >
> > From: Amir Goldstein <amir73il@gmail.com>
> >
> > In preparation for inode io modes, a server open response could fail
> > due to conflicting inode io modes.
> >
> > Allow returning an error from fuse_finish_open() and handle the error in
> > the callers. fuse_dir_open() can now call fuse_sync_release(), so handle
> > the isdir case correctly.
>
> While that's true, it may be better to just decouple the dir/regular
> paths completely, since there isn't much sharing anyway and becoming
> even less.
>

I can look into it, but for now the fix to fuse_sync_release() is a simple
one liner, so I would rather limit the changes in this series.

> > diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
> > index d19cbf34c634..d45d4a678351 100644
> > --- a/fs/fuse/dir.c
> > +++ b/fs/fuse/dir.c
> > @@ -692,13 +692,15 @@ static int fuse_create_open(struct inode *dir, struct dentry *entry,
> >         d_instantiate(entry, inode);
> >         fuse_change_entry_timeout(entry, &outentry);
> >         fuse_dir_changed(dir);
> > -       err = finish_open(file, entry, generic_file_open);
> > +       err = generic_file_open(inode, file);
> > +       if (!err) {
> > +               file->private_data = ff;
> > +               err = finish_open(file, entry, fuse_finish_open);
>
> Need to be careful with moving fuse_finish_open() call inside
> finish_open() since various fields will be different.
>
> In particular O_TRUNC in f_flags will not be cleared and in this case
> it looks undesirable.

Why? coming from fuse_open_common(), fuse_finish_open() is
called before clearing O_TRUNC.

Is fuse_finish_open() supposed to be called after clearing O_TRUNC
in fuse_create_open()?

I realize that this is what the code is doing in upstream, but it does not
look correct.

Probably, nobody could notice it, because server would probably have
truncated the file before the CREATE response anyway?

Am I missing something?

Thanks,
Amir.

  reply	other threads:[~2024-02-01 10:16 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-31 23:08 [PATCH v2 0/5] fuse: inode IO modes and mmap Bernd Schubert
2024-01-31 23:08 ` [PATCH v2 1/5] fuse: Fix VM_MAYSHARE and direct_io_allow_mmap Bernd Schubert
2024-02-01  8:45   ` Miklos Szeredi
2024-02-01 14:36     ` Bernd Schubert
2024-02-01 14:52       ` Miklos Szeredi
2024-02-01 15:39         ` Bernd Schubert
2024-02-01 15:43           ` Miklos Szeredi
2024-02-01 15:48             ` Amir Goldstein
2024-02-01 16:16               ` Bernd Schubert
2024-02-02 14:47             ` Bernd Schubert
2024-01-31 23:08 ` [PATCH v2 2/5] fuse: Create helper function if DIO write needs exclusive lock Bernd Schubert
2024-02-06  9:20   ` Jingbo Xu
2024-02-07 13:38     ` Bernd Schubert
2024-02-07 13:44       ` Jingbo Xu
2024-02-07 14:13         ` Bernd Schubert
2024-02-08  0:04           ` Jingbo Xu
2024-01-31 23:08 ` [PATCH v2 3/5] fuse: Add fuse_dio_lock/unlock helper functions Bernd Schubert
2024-01-31 23:08 ` [PATCH v2 4/5] fuse: prepare for failing open response Bernd Schubert
2024-02-01  9:23   ` Miklos Szeredi
2024-02-01 10:16     ` Amir Goldstein [this message]
2024-02-01 10:28       ` Miklos Szeredi
2024-02-01 10:41         ` Amir Goldstein
2024-02-01 10:51           ` Miklos Szeredi
2024-02-01 16:46             ` Amir Goldstein
2024-02-02 12:03               ` Amir Goldstein
2024-02-02 15:49                 ` Miklos Szeredi
2024-02-02 15:55   ` Miklos Szeredi
2024-02-02 16:07     ` Amir Goldstein
2024-01-31 23:08 ` [PATCH v2 5/5] fuse: introduce inode io modes Bernd Schubert
2024-02-01 14:47   ` Miklos Szeredi
2024-02-01 16:33     ` Amir Goldstein
2024-02-01 17:53       ` Bernd Schubert
2024-02-02 19:40         ` Amir Goldstein
2024-02-06 12:39       ` Amir Goldstein
2024-02-06 12:53         ` Miklos Szeredi
2024-02-06 13:07           ` Amir Goldstein
2024-02-01 10:30 ` [PATCH v2 0/5] fuse: inode IO modes and mmap Amir Goldstein
2024-02-01 14:30   ` Bernd Schubert
2024-02-01 15:56     ` Amir Goldstein
2024-02-01 16:01       ` Bernd Schubert

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=CAOQ4uxgv67njK9CvbUfdqF8WV_cFzrnaHdPB6-qiQuKNEDvvwA@mail.gmail.com \
    --to=amir73il@gmail.com \
    --cc=bschubert@ddn.com \
    --cc=dsingh@ddn.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /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;
as well as URLs for NNTP newsgroup(s).