[PATCH 4/4] ecryptfs: wire up nfs export operations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We have implemented export_operation to ecryptfs. This patch links it to
ecryptfs super_block to enable NFS export.

NFS uses filesystem UUID or the device number that holding the filesystem
to identify the filesystem that it exports. Ecryptfs uses the UUID of
lower filesystem as its UUID. This makes NFS cannot tell if a fsid
belongs to ecryptfs or lower filesystem. To resolve this issue, fsid has
to be given in nfs export configurations for some lower filesystems.

For example,
/btrfs/ecryptfs *(rw,no_root_squash,subtree_check,fsid=128)

Signed-off-by: Chieh Lin <jaycelin@xxxxxxxxxxxx>
---
 fs/ecryptfs/ecryptfs_kernel.h | 1 +
 fs/ecryptfs/main.c            | 1 +
 2 files changed, 2 insertions(+)

diff --git a/fs/ecryptfs/ecryptfs_kernel.h b/fs/ecryptfs/ecryptfs_kernel.h
index cd6359b5faf1..4957563a2755 100644
--- a/fs/ecryptfs/ecryptfs_kernel.h
+++ b/fs/ecryptfs/ecryptfs_kernel.h
@@ -560,6 +560,7 @@ extern const struct inode_operations ecryptfs_symlink_iops;
 extern const struct super_operations ecryptfs_sops;
 extern const struct dentry_operations ecryptfs_dops;
 extern const struct address_space_operations ecryptfs_aops;
+extern const struct export_operations ecryptfs_export_ops;
 extern int ecryptfs_verbosity;
 extern unsigned int ecryptfs_message_buf_len;
 extern signed long ecryptfs_message_wait_timeout;
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
index 025d66a705db..51d68240910b 100644
--- a/fs/ecryptfs/main.c
+++ b/fs/ecryptfs/main.c
@@ -530,6 +530,7 @@ static struct dentry *ecryptfs_mount(struct file_system_type *fs_type, int flags
 	s->s_op = &ecryptfs_sops;
 	s->s_xattr = ecryptfs_xattr_handlers;
 	s->s_d_op = &ecryptfs_dops;
+	s->s_export_op = &ecryptfs_export_ops;
 
 	err = "Reading sb failed";
 	rc = kern_path(dev_name, LOOKUP_FOLLOW | LOOKUP_DIRECTORY, &path);
-- 
2.17.1




[Index of Archives]     [Linux Crypto]     [Device Mapper Crypto]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux