X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=fs%2Fdcache.c;h=134d6775183f80b393317b5fa9d691fce7eb2fa1;hb=624dffcbcf87b9c501b13256416a82487be962bc;hp=1536f15c4d4c785a1ad2d49a78d03c5c4bd0067c;hpb=6150c32589d1976ca8a5c987df951088c05a7542;p=mv-sheeva.git diff --git a/fs/dcache.c b/fs/dcache.c index 1536f15c4d4..134d6775183 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -808,10 +808,14 @@ void d_instantiate(struct dentry *entry, struct inode * inode) * * Fill in inode information in the entry. On success, it returns NULL. * If an unhashed alias of "entry" already exists, then we return the - * aliased dentry instead. + * aliased dentry instead and drop one reference to inode. * * Note that in order to avoid conflicts with rename() etc, the caller * had better be holding the parent directory semaphore. + * + * This also assumes that the inode count has been incremented + * (or otherwise set) by the caller to indicate that it is now + * in use by the dcache. */ struct dentry *d_instantiate_unique(struct dentry *entry, struct inode *inode) { @@ -838,6 +842,7 @@ struct dentry *d_instantiate_unique(struct dentry *entry, struct inode *inode) dget_locked(alias); spin_unlock(&dcache_lock); BUG_ON(!d_unhashed(alias)); + iput(inode); return alias; } list_add(&entry->d_alias, &inode->i_dentry);