On Mon, Oct 15, 2012 at 7:07 PM, <sf...@users.sourceforge.net> wrote: > > Hmm... > Just to make sure, you can success chdir("/mnt[012]/home/username"), right? > Will you show me the output of this command? > > $ ls -ld / /mnt[012] /mnt[012]/home /mnt[012]/home/username /home > /home/username > > chdir(2) essentially calls two kernel internal functions, > user_path_dir() and inode_permission(). Can you distinguish which one > returns EACCES by ftrace or something? If not, will you try this patch > which is just for debug print? > > diff --git a/fs/open.c b/fs/open.c > index 7e4c856..26e682e 100644 > --- a/fs/open.c > +++ b/fs/open.c > @@ -382,12 +382,18 @@ SYSCALL_DEFINE1(chdir, const char __user *, filename) > int error; > > error = user_path_dir(filename, &path); > - if (error) > + if (error) { > + pr_err("%s:%d: %d\n", __func__, __LINE__, error); > goto out; > + } > > error = inode_permission(path.dentry->d_inode, MAY_EXEC | MAY_CHDIR); > - if (error) > + if (error) { > + pr_err("%s:%d: %.*s, %d\n", __func__, __LINE__, > + path.dentry->d_name.len, path.dentry->d_name.name, > + error); > goto dput_and_out; > + } > > set_fs_pwd(current->fs, &path); > > > J. R. Okajima
Unfortunately it is not easy to check chdir("/mnt[012]/home/username") since /mnt[012] are no longer available after startup. But I got the solution: Change mode of my "changes" directory from 700 to 755. Strange that it worked in aufs3.2. And ... 1) "changes" is the branch in the middle: tmpfs(empty,rw):changes(ext2,ro):squashfs(rr) The only things in "changes" are "etc/fstab" and "lib/{firmware,modules}". 2) "/home" is mounted over aufs. Anyway, after applying the patch I get the following debug output: [ 20.755352] sys_chdir:388: -2 [ 28.630147] sys_chdir:388: -13 [ 28.630162] sys_chdir:396: /, -13 Guan ------------------------------------------------------------------------------ Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev