fanghuilin / rpms / kernel

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