public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: Horst Birthelmer <horst@birthelmer.de>
To: Joanne Koong <joannelkoong@gmail.com>
Cc: Horst Birthelmer <horst@birthelmer.com>,
	 Miklos Szeredi <miklos@szeredi.hu>,
	Bernd Schubert <bschubert@ddn.com>,
	linux-kernel@vger.kernel.org,  linux-fsdevel@vger.kernel.org,
	Horst Birthelmer <hbirthelmer@ddn.com>
Subject: Re: Re: [PATCH v4 3/3] fuse: add an implementation of open+getattr
Date: Thu, 15 Jan 2026 09:19:19 +0100	[thread overview]
Message-ID: <aWigYqmD5RObGzUx@fedora> (raw)
In-Reply-To: <CAJnrk1ZtS4VfYo03UFO_khcaA6ugHiwtWQqaObB5P_ozFtsCHA@mail.gmail.com>

On Wed, Jan 14, 2026 at 06:29:26PM -0800, Joanne Koong wrote:
> On Fri, Jan 9, 2026 at 10:27 AM Horst Birthelmer <horst@birthelmer.com> wrote:
> >
> > From: Horst Birthelmer <hbirthelmer@ddn.com>
> >
> > The discussion about compound commands in fuse was
> > started over an argument to add a new operation that
> > will open a file and return its attributes in the same operation.
> >
> > Here is a demonstration of that use case with compound commands.
> >
> > Signed-off-by: Horst Birthelmer <hbirthelmer@ddn.com>
> > ---
> >  fs/fuse/file.c   | 110 +++++++++++++++++++++++++++++++++++++++++++++++--------
> >  fs/fuse/fuse_i.h |   7 +++-
> >  fs/fuse/inode.c  |   6 +++
> >  fs/fuse/ioctl.c  |   2 +-
> >  4 files changed, 107 insertions(+), 18 deletions(-)
> >
> > diff --git a/fs/fuse/file.c b/fs/fuse/file.c
> > index 53744559455d..c0375b32967d 100644
> > --- a/fs/fuse/file.c
> > +++ b/fs/fuse/file.c
> > @@ -152,8 +152,66 @@ static void fuse_file_put(struct fuse_file *ff, bool sync)
> >         }
> >  }
> >
...
> > +
> > +       err = fuse_compound_get_error(compound, 0);
> > +       if (err)
> > +               goto out;
> > +
> > +       err = fuse_compound_get_error(compound, 1);
> > +       if (err)
> > +               goto out;
> 
> Hmm, if the open succeeds but the getattr fails, why not process it
> kernel-side as a success for the open? Especially since on the server
> side, libfuse will disassemble the compound request into separate
> ones, so the server has no idea the open is even part of a compound.
> 
For this specific one (open+getattr) you are completely right. That makes total sense.
But there is the possibility in libfuse and a fuse server to process the compound as such. Especially when it has the (not defined in this patch) 'atomic' flag set.
This actually makes me think that there are multiple error handling scenarios.
1. The one we have here. Have errors for every compound request
2. it failed as a compound but no errors for the request (I have to think of a good example for this ;-) )
3. is not supported with the conditions set (like some atomic flags)

That's why I said in the other comment that we probably need two or three different functions here.
This gets complicated fast ....

Let me come up with something in the next version and see what you and the people here think.

> I haven't looked at the rest of the patch yet but this caught my
> attention when i was looking at how fuse_compound_get_error() gets
> used.
> 
> Thanks,
> Joanne
> 

Thanks,
Horst

  reply	other threads:[~2026-01-15  8:19 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-09 18:26 [PATCH v4 0/3] fuse: compound commands Horst Birthelmer
2026-01-09 18:26 ` [PATCH v4 1/3] fuse: add compound command to combine multiple requests Horst Birthelmer
2026-01-15  2:40   ` Joanne Koong
2026-01-15  8:01     ` Horst Birthelmer
2026-01-09 18:27 ` [PATCH v4 2/3] fuse: create helper functions for filling in fuse args for open and getattr Horst Birthelmer
2026-01-15  2:37   ` Joanne Koong
2026-01-15  8:06     ` Horst Birthelmer
2026-01-09 18:27 ` [PATCH v4 3/3] fuse: add an implementation of open+getattr Horst Birthelmer
2026-01-15  2:29   ` Joanne Koong
2026-01-15  8:19     ` Horst Birthelmer [this message]
2026-01-15 13:38     ` Horst Birthelmer
2026-01-15 13:41       ` Bernd Schubert
2026-01-15 13:46         ` Horst Birthelmer
2026-01-15 15:11           ` Luis Henriques
2026-01-15 15:25             ` Horst Birthelmer
2026-01-15 17:14               ` Luis Henriques

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=aWigYqmD5RObGzUx@fedora \
    --to=horst@birthelmer.de \
    --cc=bschubert@ddn.com \
    --cc=hbirthelmer@ddn.com \
    --cc=horst@birthelmer.com \
    --cc=joannelkoong@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@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