aboutsummaryrefslogtreecommitdiff
path: root/fs/affs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2008-05-09 12:35:29 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2009-03-27 14:43:56 -0400
commitec1ab0abde0af586a59541ad71841f022dcac3e7 (patch)
tree8614a3633f5d463674479fd7f28ca4dcb1b0fcf8 /fs/affs
parent8e0ee43bc2c3e19db56a4adaa9a9b04ce885cd84 (diff)
affs: fix missing unlocks in affs_remove_link
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>
Diffstat (limited to 'fs/affs')
-rw-r--r--fs/affs/amigaffs.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/affs/amigaffs.c b/fs/affs/amigaffs.c
index 805573005de..7d0f0a30f7a 100644
--- a/fs/affs/amigaffs.c
+++ b/fs/affs/amigaffs.c
@@ -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);