ext2: missing unlock in ext2_quota_write()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Monday, April 27, 2009 - 7:59 pm

Gitweb:     http://git.kernel.org/linus/a069e9cee1dba2f847839d325f46ce6976ed1b76
Commit:     a069e9cee1dba2f847839d325f46ce6976ed1b76
Parent:     fd1b52435a6d9663de896e8437ef067372916ef3
Author:     Dan Carpenter <error27@gmail.com>
AuthorDate: Thu Apr 9 18:07:10 2009 +0200
Committer:  Jan Kara <jack@suse.cz>
CommitDate: Mon Apr 27 16:49:52 2009 +0200

    ext2: missing unlock in ext2_quota_write()
    
    The inode->i_mutex should be unlocked.
    
    Found by smatch (http://repo.or.cz/w/smatch.git).  Compile tested.
    
    Signed-off-by: Dan Carpenter <error27@gmail.com>
    Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/ext2/super.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index f983225..5c4afe6 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -1395,8 +1395,10 @@ static ssize_t ext2_quota_write(struct super_block *sb, int type,
 		blk++;
 	}
 out:
-	if (len == towrite)
+	if (len == towrite) {
+		mutex_unlock(&inode->i_mutex);
 		return err;
+	}
 	if (inode->i_size < off+len-towrite)
 		i_size_write(inode, off+len-towrite);
 	inode->i_version++;
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" 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:
ext2: missing unlock in ext2_quota_write(), Linux Kernel Mailing ..., (Mon Apr 27, 7:59 pm)