* [PATCH] expfs: Fix exportfs_can_encode_fh() for EXPORT_FH_FID
@ 2025-10-01 14:52 Jan Kara
2025-10-02 9:35 ` Amir Goldstein
2025-10-06 11:02 ` Christian Brauner
0 siblings, 2 replies; 4+ messages in thread
From: Jan Kara @ 2025-10-01 14:52 UTC (permalink / raw)
To: Christian Brauner; +Cc: Amir Goldstein, linux-fsdevel, Jan Kara
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>
---
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] expfs: Fix exportfs_can_encode_fh() for EXPORT_FH_FID
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
2025-10-06 11:02 ` Christian Brauner
1 sibling, 0 replies; 4+ messages in thread
From: Amir Goldstein @ 2025-10-02 9:35 UTC (permalink / raw)
To: Jan Kara; +Cc: Christian Brauner, linux-fsdevel
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
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] expfs: Fix exportfs_can_encode_fh() for EXPORT_FH_FID
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
@ 2025-10-06 11:02 ` Christian Brauner
2025-10-06 12:27 ` Jan Kara
1 sibling, 1 reply; 4+ messages in thread
From: Christian Brauner @ 2025-10-06 11:02 UTC (permalink / raw)
To: Jan Kara; +Cc: Amir Goldstein, linux-fsdevel
On Wed, Oct 01, 2025 at 04:52:19PM +0200, Jan Kara 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: Christian Brauner <brauner@kernel.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] expfs: Fix exportfs_can_encode_fh() for EXPORT_FH_FID
2025-10-06 11:02 ` Christian Brauner
@ 2025-10-06 12:27 ` Jan Kara
0 siblings, 0 replies; 4+ messages in thread
From: Jan Kara @ 2025-10-06 12:27 UTC (permalink / raw)
To: Christian Brauner; +Cc: Jan Kara, Amir Goldstein, linux-fsdevel
On Mon 06-10-25 13:02:09, Christian Brauner wrote:
> On Wed, Oct 01, 2025 at 04:52:19PM +0200, Jan Kara 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: Christian Brauner <brauner@kernel.org>
Thanks! I've queued the patch into my tree.
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-10-06 12:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2025-10-06 11:02 ` Christian Brauner
2025-10-06 12:27 ` Jan Kara
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).