View Issue Details

IDProjectCategoryView StatusLast Update
0011327CentOS-7kernelpublic2017-05-06 13:23
ReporterJason Xin 
Status resolvedResolutionfixed 
PlatformCentOS-7-x86_64-DVD-1511OSlinuxOS Version3.10.0-327
Product Version 
Target VersionFixed in Version 
Summary0011327: Cannot build the kernel with eCryptfs
DescriptionI find centos7(1511) doesn't build eCryptfs. Then i rebuilt kernel with eCryptfs as module. When i execute "sudo make" command, there're something wrong:
fs/ecryptfs/main.c: In function ‘ecryptfs_mount’:
fs/ecryptfs/main.c:570:3: error: ‘struct super_block’ has no member named ‘s_stack_depth’
  s->s_stack_depth = path.dentry->d_sb->s_stack_depth + 1;
fs/ecryptfs/main.c:570:38: error: ‘struct super_block’ has no member named ‘s_stack_depth’
  s->s_stack_depth = path.dentry->d_sb->s_stack_depth + 1;
fs/ecryptfs/main.c:573:7: error: ‘struct super_block’ has no member named ‘s_stack_depth’
  if (s->s_stack_depth > FILESYSTEM_MAX_STACK_DEPTH) {
Then i check struct super_block in include/linux/fs.h, sb does not include s_stack_depth indeed!
TagsNo tags attached.




2017-05-05 07:21

reporter   ~0029232

To rebuild kernel with ecryptfs as module, you have to do some changes in linux-3.10.0-327.el7/fs/ecryptfs/main.c file for resolution of those errors at the time of make.

What you have to do:

1. search ecryptfs_mount function in main.c file
2. declare an int pointer at the beginning of the that function

Below are are changes in main.c file:

static struct dentry *ecryptfs_mount(struct file_system_type *fs_type, int flags, const char *dev_name, void *raw_data)
int *s_stack_depth;

//s->s_stack_depth = path.dentry->d_sb->s_stack_depth + 1;
s_stack_depth = get_s_stack_depth(path.dentry->d_sb);
rc = -EINVAL;
//if (s->s_stack_depth > FILESYSTEM_MAX_STACK_DEPTH) {
if ( *s_stack_depth > FILESYSTEM_MAX_STACK_DEPTH) {
pr_err("eCryptfs: maximum fs stacking depth exceeded\n");
goto out_free;

It works for me for building of kernel with ecryptfs module for centos 7.


2017-05-05 17:22

manager   ~0029239

Thanks, @insmaheshw, for the note about the fix.

@Jason Xin,

The centosplus kernel (kernel-plus) has ecryptfs enabled. You can find the patch used in this kernel here:
Jason Xin

Jason Xin

2017-05-06 13:15

reporter   ~0029241

Thanks for the note!

Actually, I have already fixed it a couple months ago by myself. At that time, I don't know how to make patch and submit it, so I just let it go...

Issue History

Date Modified Username Field Change
2016-08-21 06:07 Jason Xin New Issue
2017-05-05 07:21 insmaheshw Note Added: 0029232
2017-05-05 17:22 toracat Note Added: 0029239
2017-05-05 17:22 toracat Status new => assigned
2017-05-06 13:15 Jason Xin Note Added: 0029241
2017-05-06 13:23 toracat Status assigned => resolved
2017-05-06 13:23 toracat Resolution open => fixed