]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/jffs2/dir.c
[JFFS2] Use d_splice_alias() not d_add() in jffs2_lookup()
[linux-2.6-omap-h63xx.git] / fs / jffs2 / dir.c
index cd219ef552543cdc98d0a392f95cd6dc1c3ec4fd..621bdfa994e71268d0f85f27e938765e12937c8e 100644 (file)
@@ -108,9 +108,7 @@ static struct dentry *jffs2_lookup(struct inode *dir_i, struct dentry *target,
                }
        }
 
-       d_add(target, inode);
-
-       return NULL;
+       return d_splice_alias(inode, target);
 }
 
 /***********************************************************************/
@@ -311,7 +309,7 @@ static int jffs2_symlink (struct inode *dir_i, struct dentry *dentry, const char
        /* FIXME: If you care. We'd need to use frags for the target
           if it grows much more than this */
        if (targetlen > 254)
-               return -EINVAL;
+               return -ENAMETOOLONG;
 
        ri = jffs2_alloc_raw_inode();