]> Pileus Git - ~andy/linux/blobdiff - fs/namei.c
fix bogus path_put() of nd->root after some unlazy_walk() failures
[~andy/linux] / fs / namei.c
index e029a4cbff7db7b23af15628ca4d8c2cac5da491..c53d3a9547f9295408fa3cfe0d5abfb72023e29e 100644 (file)
@@ -513,8 +513,7 @@ static int unlazy_walk(struct nameidata *nd, struct dentry *dentry)
 
        if (!lockref_get_not_dead(&parent->d_lockref)) {
                nd->path.dentry = NULL; 
-               rcu_read_unlock();
-               return -ECHILD;
+               goto out;
        }
 
        /*
@@ -2435,6 +2434,7 @@ static int may_delete(struct inode *dir, struct dentry *victim, bool isdir)
  */
 static inline int may_create(struct inode *dir, struct dentry *child)
 {
+       audit_inode_child(dir, child, AUDIT_TYPE_CHILD_CREATE);
        if (child->d_inode)
                return -EEXIST;
        if (IS_DEADDIR(dir))