diff options
Diffstat (limited to 'fs/jffs2/dir.c')
-rw-r--r-- | fs/jffs2/dir.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/jffs2/dir.c b/fs/jffs2/dir.c index 4bca6a2e5c07..5f243cd63afc 100644 --- a/fs/jffs2/dir.c +++ b/fs/jffs2/dir.c | |||
@@ -102,10 +102,8 @@ static struct dentry *jffs2_lookup(struct inode *dir_i, struct dentry *target, | |||
102 | mutex_unlock(&dir_f->sem); | 102 | mutex_unlock(&dir_f->sem); |
103 | if (ino) { | 103 | if (ino) { |
104 | inode = jffs2_iget(dir_i->i_sb, ino); | 104 | inode = jffs2_iget(dir_i->i_sb, ino); |
105 | if (IS_ERR(inode)) { | 105 | if (IS_ERR(inode)) |
106 | printk(KERN_WARNING "iget() failed for ino #%u\n", ino); | 106 | printk(KERN_WARNING "iget() failed for ino #%u\n", ino); |
107 | return ERR_CAST(inode); | ||
108 | } | ||
109 | } | 107 | } |
110 | 108 | ||
111 | return d_splice_alias(inode, target); | 109 | return d_splice_alias(inode, target); |
@@ -822,7 +820,10 @@ static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry, | |||
822 | 820 | ||
823 | if (victim_f) { | 821 | if (victim_f) { |
824 | /* There was a victim. Kill it off nicely */ | 822 | /* There was a victim. Kill it off nicely */ |
825 | drop_nlink(new_dentry->d_inode); | 823 | if (S_ISDIR(new_dentry->d_inode->i_mode)) |
824 | clear_nlink(new_dentry->d_inode); | ||
825 | else | ||
826 | drop_nlink(new_dentry->d_inode); | ||
826 | /* Don't oops if the victim was a dirent pointing to an | 827 | /* Don't oops if the victim was a dirent pointing to an |
827 | inode which didn't exist. */ | 828 | inode which didn't exist. */ |
828 | if (victim_f->inocache) { | 829 | if (victim_f->inocache) { |