[PATCH 16/29] ovl: add EXPORT_OP_STABLE_HANDLES flag to export operations

Amir Goldstein amir73il at gmail.com
Fri Jan 16 05:21:56 AEDT 2026


On Thu, Jan 15, 2026 at 6:49 PM Jeff Layton <jlayton at kernel.org> wrote:
>
> Add the EXPORT_OP_STABLE_HANDLES flag to overlayfs export operations to indicate
> that this filesystem can be exported via NFS.
>
> Signed-off-by: Jeff Layton <jlayton at kernel.org>
> ---
>  fs/overlayfs/export.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/fs/overlayfs/export.c b/fs/overlayfs/export.c
> index 83f80fdb156749e65a4ea0ab708cbff338dacdad..17c92a228120e1803135cc2b4fe4180f5e343f88 100644
> --- a/fs/overlayfs/export.c
> +++ b/fs/overlayfs/export.c
> @@ -865,9 +865,11 @@ const struct export_operations ovl_export_operations = {
>         .fh_to_parent   = ovl_fh_to_parent,
>         .get_name       = ovl_get_name,
>         .get_parent     = ovl_get_parent,
> +       .flags          = EXPORT_OP_STABLE_HANDLES,
>  };
>
>  /* encode_fh() encodes non-decodable file handles with nfs_export=off */
>  const struct export_operations ovl_export_fid_operations = {
>         .encode_fh      = ovl_encode_fh,
> +       .flags          = EXPORT_OP_STABLE_HANDLES,
>  };
>

Actually, see comment above:
/* encode_fh() encodes non-decodable file handles with nfs_export=off */

That's the variant of export_ops when overlayfs cannot be nfs exported
because its encoded file handles can change after copyup+reboot.

Thanks,
Amir.


More information about the Linux-erofs mailing list