Skip to content

Commit

Permalink
affs: fix missing unlocks in affs_remove_link
Browse files Browse the repository at this point in the history
In two error cases affs_remove_link doesn't call affs_unlock_dir to
release the i_hash_lock semaphore.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Christoph Hellwig authored and Al Viro committed Mar 27, 2009
1 parent 8e0ee43 commit ec1ab0a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions fs/affs/amigaffs.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,18 @@ affs_remove_link(struct dentry *dentry)
affs_lock_dir(dir);
affs_fix_dcache(dentry, link_ino);
retval = affs_remove_hash(dir, link_bh);
if (retval)
if (retval) {
affs_unlock_dir(dir);
goto done;
}
mark_buffer_dirty_inode(link_bh, inode);

memcpy(AFFS_TAIL(sb, bh)->name, AFFS_TAIL(sb, link_bh)->name, 32);
retval = affs_insert_hash(dir, bh);
if (retval)
if (retval) {
affs_unlock_dir(dir);
goto done;
}
mark_buffer_dirty_inode(bh, inode);

affs_unlock_dir(dir);
Expand Down

0 comments on commit ec1ab0a

Please sign in to comment.