Skip to contentSkip to conversation

nilfs2: fix missing unlock in error path of nilfs_mdt_write_page

PATCH New Ryusuke Konishi 1 participant 1 message Aug 2, 2009 NILFS2 filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nilfs2: fix missing unlock in error path of nilfs_mdt_write_page

I found a mutex leak while looking into a kernel oops detected in shrink_page_list().

Here is a bugfix of the problem. I'll send it to the next -rc along with other fixes.

Regards,
Ryusuke Konishi
--
From: Ryusuke Konishi <[email protected]>

nilfs2: fix missing unlock in error path of nilfs_mdt_write_page

This adds a missing unlock of nilfs->ns_writer_mutex in nilfs_mdt_write_page() function.

---
 fs/nilfs2/mdt.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
fs/nilfs2/mdt.c +3 -1
index 3d3ddb3..2dfd477 100644
@@ -412,8 +412,10 @@ nilfs_mdt_write_page(struct page *page, struct writeback_control *wbc)
 		return 0; /* Do not request flush for shadow page cache */
 	if (!sb) {
 		writer = nilfs_get_writer(NILFS_MDT(inode)->mi_nilfs);
-		if (!writer)
+		if (!writer) {
+			nilfs_put_writer(NILFS_MDT(inode)->mi_nilfs);
 			return -EROFS;
+		}
 		sb = writer->s_super;
 	}
 
Signature · 1 line
1.6.3.4