ignatenkobrain / rpms / kernel

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