lift path_put(path) to callers of __do_follow_link()
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 8 Aug 2009 21:32:02 +0000 (01:32 +0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 16 Dec 2009 17:16:43 +0000 (12:16 -0500)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namei.c

index 87f97ba90ad17d271baf15b2b2e65381a583c163..30c61c298b4cc641ea823ef8bdfcb74b6e5642fa 100644 (file)
@@ -644,8 +644,6 @@ static __always_inline int __do_follow_link(struct path *path, struct nameidata
                if (dentry->d_inode->i_op->put_link)
                        dentry->d_inode->i_op->put_link(dentry, nd, cookie);
        }
-       path_put(path);
-
        return error;
 }
 
@@ -672,6 +670,7 @@ static inline int do_follow_link(struct path *path, struct nameidata *nd)
        current->total_link_count++;
        nd->depth++;
        err = __do_follow_link(path, nd);
+       path_put(path);
        current->link_count--;
        nd->depth--;
        return err;
@@ -1864,6 +1863,7 @@ do_link:
        if (error)
                goto exit_dput;
        error = __do_follow_link(&path, &nd);
+       path_put(&path);
        if (error) {
                /* Does someone understand code flow here? Or it is only
                 * me so stupid? Anathema to whoever designed this non-sense