diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-09-11 04:34:46 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-09-11 04:34:46 -0300 |
commit | 863981e96738983919de841ec669e157e6bdaeb0 (patch) | |
tree | d6d89a12e7eb8017837c057935a2271290907f76 /fs/aufs/plink.c | |
parent | 8dec7c70575785729a6a9e6719a955e9c545bcab (diff) |
Linux-libre 4.7.1-gnupck-4.7.1-gnu
Diffstat (limited to 'fs/aufs/plink.c')
-rw-r--r-- | fs/aufs/plink.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/fs/aufs/plink.c b/fs/aufs/plink.c index c42734dd4..d8d75e85d 100644 --- a/fs/aufs/plink.c +++ b/fs/aufs/plink.c @@ -32,6 +32,7 @@ int au_plink_maint(struct super_block *sb, int flags) { int err; pid_t pid, ppid; + struct task_struct *parent, *prev; struct au_sbinfo *sbi; SiMustAnyLock(sb); @@ -46,11 +47,22 @@ int au_plink_maint(struct super_block *sb, int flags) goto out; /* todo: it highly depends upon /sbin/mount.aufs */ + prev = NULL; + parent = current; + ppid = 0; rcu_read_lock(); - ppid = task_pid_vnr(rcu_dereference(current->real_parent)); + while (1) { + parent = rcu_dereference(parent->real_parent); + if (parent == prev) + break; + ppid = task_pid_vnr(parent); + if (pid == ppid) { + rcu_read_unlock(); + goto out; + } + prev = parent; + } rcu_read_unlock(); - if (pid == ppid) - goto out; if (au_ftest_lock(flags, NOPLMW)) { /* if there is no i_mutex lock in VFS, we don't need to wait */ |