jingni / rpms / kernel

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