From 483cb295d79f2d8a399d50c4b58a2207d24ecdc2 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Thu, 24 Dec 2009 02:02:38 -0500 Subject: [PATCH] --- yaml --- r: 185917 b: refs/heads/master c: 3343eb8209cc69f0d2059f8c484ad7a3e1834c0b h: refs/heads/master i: 185915: 5e72292cff525746565a1e0a3a904f166571877c v: v3 --- [refs] | 2 +- trunk/fs/namei.c | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index dd3a0a3e6e65..20bc5a5283aa 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: fb1cc555d533869910e20de4b8d5147570afdfad +refs/heads/master: 3343eb8209cc69f0d2059f8c484ad7a3e1834c0b diff --git a/trunk/fs/namei.c b/trunk/fs/namei.c index 3c39fa1608c5..bff27c08134c 100644 --- a/trunk/fs/namei.c +++ b/trunk/fs/namei.c @@ -1685,8 +1685,6 @@ static struct file *do_last(struct nameidata *nd, struct path *path, } filp = nameidata_to_filp(nd); mnt_drop_write(nd->path.mnt); - if (nd->root.mnt) - path_put(&nd->root); if (!IS_ERR(filp)) { error = ima_file_check(filp, acc_mode); if (error) { @@ -1726,8 +1724,6 @@ static struct file *do_last(struct nameidata *nd, struct path *path, if (S_ISDIR(path->dentry->d_inode->i_mode)) goto exit; filp = finish_open(nd, open_flag, flag, acc_mode); - if (nd->root.mnt) - path_put(&nd->root); return filp; exit_mutex_unlock: @@ -1737,8 +1733,6 @@ static struct file *do_last(struct nameidata *nd, struct path *path, exit: if (!IS_ERR(nd->intent.open.file)) release_open_intent(nd); - if (nd->root.mnt) - path_put(&nd->root); path_put(&nd->path); return ERR_PTR(error); } @@ -1857,6 +1851,8 @@ struct file *do_filp_open(int dfd, const char *pathname, pathname, dir, &is_link); if (is_link) goto do_link; + if (nd.root.mnt) + path_put(&nd.root); return filp; ok: