[Ocfs2-devel] [patch] unlock i_mutex in error path

Dan Carpenter error27 at gmail.com
Wed Apr 8 03:48:23 PDT 2009


There is an error path in ocfs2_quota_write() that doesn't unlock 
&gqinode->i_mutex().  That seems unintentional.

Found by smatch (http://repo.or.cz/w/smatch.git).  Compile tested.

regards,
dan carpenter

Signed-off-by: Dan Carpenter <error27 at gmail.com>

--- orig/fs/ocfs2/quota_global.c	2009-04-07 19:34:22.000000000 +0300
+++ devel/fs/ocfs2/quota_global.c	2009-04-07 19:34:25.000000000 +0300
@@ -232,10 +232,8 @@
 		err = ocfs2_get_quota_block(gqinode, blk, &bh);
 		ja_type = OCFS2_JOURNAL_ACCESS_CREATE;
 	}
-	if (err) {
-		mlog_errno(err);
-		return err;
-	}
+	if (err) 
+		goto out;
 	lock_buffer(bh);
 	if (new)
 		memset(bh->b_data, 0, sb->s_blocksize);



More information about the Ocfs2-devel mailing list