Skip to contentSkip to conversation

affs: fix missing unlocks in affs_remove_link

PATCH In review Christoph Hellwig 1 participant 4 messages May 9, 2008 – Sep 8, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

fs/affs/amigaffs.c +6 -2
Index: linux-2.6/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);
#1 lore raw

ping?

Quoted 21 lines · Christoph Hellwig

In two error cases affs_remove_link doesn't call affs_unlock_dir to release the i_hash_lock semaphore.

Index: linux-2.6/fs/affs/amigaffs.c
===================================================================

fs/affs/amigaffs.c +3 -1
@@ -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);
 

fs/affs/amigaffs.c affs_remove_link(struct dentry *dentry) · line 196

Quoted 10 lines
fs/affs/amigaffs.c +3 -1
 		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);

---end quoted text---

#2 lore raw

ping?

Quoted 33 lines · Christoph Hellwig

ping?

Quoted 30 lines · Christoph Hellwig

In two error cases affs_remove_link doesn't call affs_unlock_dir to release the i_hash_lock semaphore.

Index: linux-2.6/fs/affs/amigaffs.c
===================================================================

fs/affs/amigaffs.c +6 -2
@@ -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);
 
Quoted 2 lines

fs/affs/amigaffs.c affs_remove_link(struct dentry *dentry) · line 196

Quoted 1 line
fs/affs/amigaffs.c +0 -0
 		affs_unlock_dir(dir);

---end quoted text---

---end quoted text---

#3 lore raw

ping^3?

Quoted 36 lines · Christoph Hellwig

ping?

Quoted 33 lines · Christoph Hellwig

ping?

Quoted 30 lines · Christoph Hellwig

In two error cases affs_remove_link doesn't call affs_unlock_dir to release the i_hash_lock semaphore.

Index: linux-2.6/fs/affs/amigaffs.c
===================================================================

fs/affs/amigaffs.c +6 -2
@@ -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);
 
Quoted 3 lines
Quoted 2 lines

fs/affs/amigaffs.c affs_remove_link(struct dentry *dentry) · line 196

Quoted 1 line
fs/affs/amigaffs.c +0 -0
 		affs_unlock_dir(dir);

---end quoted text---

---end quoted text---

---end quoted text---