aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/auditsc.c4
-rw-r--r--kernel/exit.c12
-rw-r--r--kernel/fork.c18
3 files changed, 15 insertions, 19 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index 1c06ecf38d7b..741291a1de0d 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -1697,8 +1697,8 @@ void __audit_getname(const char *name)
1697 ++context->name_count; 1697 ++context->name_count;
1698 if (!context->pwd) { 1698 if (!context->pwd) {
1699 read_lock(&current->fs->lock); 1699 read_lock(&current->fs->lock);
1700 context->pwd = dget(current->fs->pwd); 1700 context->pwd = dget(current->fs->pwd.dentry);
1701 context->pwdmnt = mntget(current->fs->pwdmnt); 1701 context->pwdmnt = mntget(current->fs->pwd.mnt);
1702 read_unlock(&current->fs->lock); 1702 read_unlock(&current->fs->lock);
1703 } 1703 }
1704 1704
diff --git a/kernel/exit.c b/kernel/exit.c
index 3b893e78ce61..506a957b665a 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -512,14 +512,10 @@ static void __put_fs_struct(struct fs_struct *fs)
512{ 512{
513 /* No need to hold fs->lock if we are killing it */ 513 /* No need to hold fs->lock if we are killing it */
514 if (atomic_dec_and_test(&fs->count)) { 514 if (atomic_dec_and_test(&fs->count)) {
515 dput(fs->root); 515 path_put(&fs->root);
516 mntput(fs->rootmnt); 516 path_put(&fs->pwd);
517 dput(fs->pwd); 517 if (fs->altroot.dentry)
518 mntput(fs->pwdmnt); 518 path_put(&fs->altroot);
519 if (fs->altroot) {
520 dput(fs->altroot);
521 mntput(fs->altrootmnt);
522 }
523 kmem_cache_free(fs_cachep, fs); 519 kmem_cache_free(fs_cachep, fs);
524 } 520 }
525} 521}
diff --git a/kernel/fork.c b/kernel/fork.c
index 4363a4eb84e3..dd249c37b3a3 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -600,16 +600,16 @@ static struct fs_struct *__copy_fs_struct(struct fs_struct *old)
600 rwlock_init(&fs->lock); 600 rwlock_init(&fs->lock);
601 fs->umask = old->umask; 601 fs->umask = old->umask;
602 read_lock(&old->lock); 602 read_lock(&old->lock);
603 fs->rootmnt = mntget(old->rootmnt); 603 fs->root = old->root;
604 fs->root = dget(old->root); 604 path_get(&old->root);
605 fs->pwdmnt = mntget(old->pwdmnt); 605 fs->pwd = old->pwd;
606 fs->pwd = dget(old->pwd); 606 path_get(&old->pwd);
607 if (old->altroot) { 607 if (old->altroot.dentry) {
608 fs->altrootmnt = mntget(old->altrootmnt); 608 fs->altroot = old->altroot;
609 fs->altroot = dget(old->altroot); 609 path_get(&old->altroot);
610 } else { 610 } else {
611 fs->altrootmnt = NULL; 611 fs->altroot.mnt = NULL;
612 fs->altroot = NULL; 612 fs->altroot.dentry = NULL;
613 } 613 }
614 read_unlock(&old->lock); 614 read_unlock(&old->lock);
615 } 615 }