chengshan / rpms / kernel

Forked from rpms/kernel 2 years ago
Clone
24d93b
https://bugs.centos.org/view.php?id=7369
24d93b
http://kozlex.blogspot.com/2015/05/building-ecryptfs-on-redhat-7_19.html
24d93b
24d93b
To fix ecryptfs and build it in the kernel follow is the partial fix:
24d93b
This is a fix that will not be proposed to upstream cause it is not 
24d93b
compatible with other kernels; instead it is a patch to make ecryptfs 
24d93b
work on Rhel7 only.
24d93b
24d93b
--- a/fs/ecryptfs/main.c	2015-03-06 13:45:38.000000000 -0800
24d93b
+++ b/fs/ecryptfs/main.c	2015-07-02 14:46:37.000000000 -0700
24d93b
@@ -500,6 +500,7 @@ static struct dentry *ecryptfs_mount(str
24d93b
 	struct path path;
24d93b
 	uid_t check_ruid;
24d93b
 	int rc;
24d93b
+	int *s_stack_depth;
24d93b
 
24d93b
 	sbi = kmem_cache_zalloc(ecryptfs_sb_info_cache, GFP_KERNEL);
24d93b
 	if (!sbi) {
24d93b
@@ -567,10 +568,10 @@ static struct dentry *ecryptfs_mount(str
24d93b
 	s->s_maxbytes = path.dentry->d_sb->s_maxbytes;
24d93b
 	s->s_blocksize = path.dentry->d_sb->s_blocksize;
24d93b
 	s->s_magic = ECRYPTFS_SUPER_MAGIC;
24d93b
-	s->s_stack_depth = path.dentry->d_sb->s_stack_depth + 1;
24d93b
+	s_stack_depth = get_s_stack_depth(path.dentry->d_sb);
24d93b
 
24d93b
 	rc = -EINVAL;
24d93b
-	if (s->s_stack_depth > FILESYSTEM_MAX_STACK_DEPTH) {
24d93b
+	if ( *s_stack_depth > FILESYSTEM_MAX_STACK_DEPTH) {
24d93b
 		pr_err("eCryptfs: maximum fs stacking depth exceeded\n");
24d93b
 		goto out_free;
24d93b
 	}