Documentation/filesystems/nfs/reexport.rst

Source file repositories/reference/linux-study-clean/Documentation/filesystems/nfs/reexport.rst

File Facts

System
Linux kernel
Corpus path
Documentation/filesystems/nfs/reexport.rst
Extension
.rst
Size
4757 bytes
Lines
118
Domain
Support Tooling And Documentation
Bucket
Documentation
Inferred role
Support Tooling And Documentation: documentation
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

Reexporting NFS filesystems
===========================

Overview
--------

It is possible to reexport an NFS filesystem over NFS.  However, this
feature comes with a number of limitations.  Before trying it, we
recommend some careful research to determine whether it will work for
your purposes.

A discussion of current known limitations follows.

"fsid=" required, crossmnt broken
---------------------------------

We require the "fsid=" export option on any reexport of an NFS
filesystem.  You can use "uuidgen -r" to generate a unique argument.

The "crossmnt" export does not propagate "fsid=", so it will not allow
traversing into further nfs filesystems; if you wish to export nfs
filesystems mounted under the exported filesystem, you'll need to export
them explicitly, assigning each its own unique "fsid= option.

Reboot recovery
---------------

The NFS protocol's normal reboot recovery mechanisms don't work for the
case when the reexport server reboots because the source server has not
rebooted, and so it is not in grace.  Since the source server is not in
grace, it cannot offer any guarantees that the file won't have been
changed between the locks getting lost and any attempt to recover them.
The same applies to delegations and any associated locks.  Clients are
not allowed to get file locks or delegations from a reexport server, any
attempts will fail with operation not supported.

Filehandle limits
-----------------

If the original server uses an X byte filehandle for a given object, the
reexport server's filehandle for the reexported object will be X+22
bytes, rounded up to the nearest multiple of four bytes.

The result must fit into the RFC-mandated filehandle size limits:

+-------+-----------+
| NFSv2 |  32 bytes |
+-------+-----------+
| NFSv3 |  64 bytes |
+-------+-----------+
| NFSv4 | 128 bytes |
+-------+-----------+

So, for example, you will only be able to reexport a filesystem over
NFSv2 if the original server gives you filehandles that fit in 10
bytes--which is unlikely.

In general there's no way to know the maximum filehandle size given out
by an NFS server without asking the server vendor.

But the following table gives a few examples.  The first column is the
typical length of the filehandle from a Linux server exporting the given
filesystem, the second is the length after that nfs export is reexported
by another Linux host:

+--------+-------------------+----------------+
|        | filehandle length | after reexport |
+========+===================+================+
| ext4:  | 28 bytes          | 52 bytes       |
+--------+-------------------+----------------+

Annotation

Implementation Notes