aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/affs/amigaffs.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/affs/amigaffs.c b/fs/affs/amigaffs.c
index 1c7fd7928d1f..843cdc994804 100644
--- a/fs/affs/amigaffs.c
+++ b/fs/affs/amigaffs.c
@@ -122,15 +122,13 @@ affs_remove_hash(struct inode *dir, struct buffer_head *rem_bh)
122} 122}
123 123
124static void 124static void
125affs_fix_dcache(struct dentry *dentry, u32 entry_ino) 125affs_fix_dcache(struct inode *inode, u32 entry_ino)
126{ 126{
127 struct inode *inode = dentry->d_inode; 127 struct dentry *dentry;
128 void *data = dentry->d_fsdata;
129
130 spin_lock(&inode->i_lock); 128 spin_lock(&inode->i_lock);
131 list_for_each_entry(dentry, &inode->i_dentry, d_alias) { 129 list_for_each_entry(dentry, &inode->i_dentry, d_alias) {
132 if (entry_ino == (u32)(long)dentry->d_fsdata) { 130 if (entry_ino == (u32)(long)dentry->d_fsdata) {
133 dentry->d_fsdata = data; 131 dentry->d_fsdata = (void *)inode->i_ino;
134 break; 132 break;
135 } 133 }
136 } 134 }
@@ -172,7 +170,11 @@ affs_remove_link(struct dentry *dentry)
172 } 170 }
173 171
174 affs_lock_dir(dir); 172 affs_lock_dir(dir);
175 affs_fix_dcache(dentry, link_ino); 173 /*
174 * if there's a dentry for that block, make it
175 * refer to inode itself.
176 */
177 affs_fix_dcache(inode, link_ino);
176 retval = affs_remove_hash(dir, link_bh); 178 retval = affs_remove_hash(dir, link_bh);
177 if (retval) { 179 if (retval) {
178 affs_unlock_dir(dir); 180 affs_unlock_dir(dir);