linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Jan Kara <jack@suse.cz>
Cc: Christian Brauner <brauner@kernel.org>, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] expfs: Fix exportfs_can_encode_fh() for EXPORT_FH_FID
Date: Thu, 2 Oct 2025 11:35:36 +0200	[thread overview]
Message-ID: <CAOQ4uxhzJ=1a+3FqO1p0AmuOYWKdGvq7cboo49RF2ngGCJi89w@mail.gmail.com> (raw)
In-Reply-To: <20251001145218.24219-2-jack@suse.cz>

On Wed, Oct 1, 2025 at 4:52 PM Jan Kara <jack@suse.cz> wrote:
>
> After commit 5402c4d4d200 ("exportfs: require ->fh_to_parent() to encode
> connectable file handles") we will fail to create non-decodable file
> handles for filesystems without export operations. Fix it.
>
> Fixes: 5402c4d4d200 ("exportfs: require ->fh_to_parent() to encode connectable file handles")
> Signed-off-by: Jan Kara <jack@suse.cz>

Reviewed-by: Amir Goldstein <amir73il@gmail.com>

> ---
>  include/linux/exportfs.h | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h
> index cfb0dd1ea49c..b80286a73d0a 100644
> --- a/include/linux/exportfs.h
> +++ b/include/linux/exportfs.h
> @@ -314,9 +314,6 @@ static inline bool exportfs_can_decode_fh(const struct export_operations *nop)
>  static inline bool exportfs_can_encode_fh(const struct export_operations *nop,
>                                           int fh_flags)
>  {
> -       if (!nop)
> -               return false;
> -
>         /*
>          * If a non-decodeable file handle was requested, we only need to make
>          * sure that filesystem did not opt-out of encoding fid.
> @@ -324,6 +321,10 @@ static inline bool exportfs_can_encode_fh(const struct export_operations *nop,
>         if (fh_flags & EXPORT_FH_FID)
>                 return exportfs_can_encode_fid(nop);
>
> +       /* Normal file handles cannot be created without export ops */
> +       if (!nop)
> +               return false;
> +
>         /*
>          * If a connectable file handle was requested, we need to make sure that
>          * filesystem can also decode connected file handles.
> --
> 2.51.0
>

  reply	other threads:[~2025-10-02  9:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-01 14:52 [PATCH] expfs: Fix exportfs_can_encode_fh() for EXPORT_FH_FID Jan Kara
2025-10-02  9:35 ` Amir Goldstein [this message]
2025-10-06 11:02 ` Christian Brauner
2025-10-06 12:27   ` Jan Kara

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='CAOQ4uxhzJ=1a+3FqO1p0AmuOYWKdGvq7cboo49RF2ngGCJi89w@mail.gmail.com' \
    --to=amir73il@gmail.com \
    --cc=brauner@kernel.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    /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).