ovl: do not allow nfs_export with data-only layers
Subsystems (2)
Amir Goldstein
maintainerPATCH 1/1 ovl: do not allow nfs_export with data-only layers
Since data-only layers no longer require metacopy=on, which conflicts with nfs_export=on, an overlay with data-only layers can be mounted with nfs_export=on.
Decoding a file handle of a lower metacopy file whose data is in a data-only layer builds the inode only from the decoded lower dentry, without the lazy lowerdata redirect, so the data of the file would be read from the metacopy file in the lower layer.
Fail the mount with explicit nfs_export=on and data-only layers and otherwise disable nfs_export with data-only layers.
Fixes 5ef7bcdeecc9 ("ovl: relax redirect/metacopy requirements for lower -> data redirect")
Signed-off-by Amir Goldstein <[email protected]>
--- fs/overlayfs/params.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
fs/overlayfs/params.c +10 -0
@@ -931,6 +931,16 @@ int ovl_fs_params_verify(const struct ovl_fs_context *ctx, } } +/* Resolve nfs_export -> !data-only layers dependency */ +if (config->nfs_export && ctx->nr_data) { +if (set.nfs_export) { +pr_err ("NFS export is not supported with data-only layers\n" ); +return -EINVAL ; + } +pr_info ("disabling nfs_export due to data-only layers\n" ); + config->nfs_export = false; + } +/* Resolve nfs_export -> index dependency */ if (config->nfs_export && !config->index) { if (!config->upperdir &&
Signature · 1 line
2.56.0