login
Header Space

 
 

[PATCH] affs: fix missing unlocks in affs_remove_link

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Roman Zippel <zippel@...>
Cc: <linux-fsdevel@...>
Date: Friday, May 9, 2008 - 6:35 am

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>

Index: linux-2.6/fs/affs/amigaffs.c
===================================================================
--- linux-2.6.orig/fs/affs/amigaffs.c	2008-04-29 17:15:30.000000000 +0200
+++ linux-2.6/fs/affs/amigaffs.c	2008-04-29 17:16:15.000000000 +0200
@@ -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);
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] affs: fix missing unlocks in affs_remove_link, Christoph Hellwig, (Fri May 9, 6:35 am)
Re: [PATCH] affs: fix missing unlocks in affs_remove_link, Christoph Hellwig, (Wed May 21, 8:38 am)
speck-geostationary