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>
This commit is contained in:
Christoph Hellwig 2008-05-09 12:35:29 +02:00 коммит произвёл Al Viro
Родитель 8e0ee43bc2
Коммит ec1ab0abde
1 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -179,14 +179,18 @@ affs_remove_link(struct dentry *dentry)
affs_lock_dir(dir); affs_lock_dir(dir);
affs_fix_dcache(dentry, link_ino); affs_fix_dcache(dentry, link_ino);
retval = affs_remove_hash(dir, link_bh); retval = affs_remove_hash(dir, link_bh);
if (retval) if (retval) {
affs_unlock_dir(dir);
goto done; goto done;
}
mark_buffer_dirty_inode(link_bh, inode); mark_buffer_dirty_inode(link_bh, inode);
memcpy(AFFS_TAIL(sb, bh)->name, AFFS_TAIL(sb, link_bh)->name, 32); memcpy(AFFS_TAIL(sb, bh)->name, AFFS_TAIL(sb, link_bh)->name, 32);
retval = affs_insert_hash(dir, bh); retval = affs_insert_hash(dir, bh);
if (retval) if (retval) {
affs_unlock_dir(dir);
goto done; goto done;
}
mark_buffer_dirty_inode(bh, inode); mark_buffer_dirty_inode(bh, inode);
affs_unlock_dir(dir); affs_unlock_dir(dir);