Commit 09739cf7 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] PATCH 2 of 4 : knfsd : Allow exporting of deviceless filesystems if fsid= given

Previously we could only export FS_REQUIRES_DEV filesystems
as we need a devno to put in the filehandle.
Now that we have fsid= (NFSEXP_FSID) we don't need a devno
to put in the filehandle so we can relax this requirement.
parent 976c3111
......@@ -304,9 +304,21 @@ exp_export(struct nfsctl_export *nxp)
goto finish;
err = -EINVAL;
if (!(inode->i_sb->s_type->fs_flags & FS_REQUIRES_DEV) ||
(inode->i_sb->s_op->read_inode == NULL
&& inode->i_sb->s_op->fh_to_dentry == NULL)) {
/* There are two requirements on a filesystem to be exportable.
* 1: We must be able to identify the filesystem from a number.
* either a device number (so FS_REQUIRES_DEV needed)
* or an FSID number (so NFSEXP_FSID needed).
* 2: We must be able to find an inode from a filehandle.
* either using fh_to_dentry (prefered)
* or using read_inode (the hack).
*/
if (((inode->i_sb->s_type->fs_flags & FS_REQUIRES_DEV)
|| (nxp->ex_flags & NFSEXP_FSID))
&&
(inode->i_sb->s_op->read_inode
|| inode->i_sb->s_op->fh_to_dentry))
/* Ok, we can export it */;
else {
dprintk("exp_export: export of invalid fs type.\n");
goto finish;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment