Skip to contentSkip to conversation

missing unlock in ext2_quota_write()

PATCH In review Dan Carpenter 2 participants 2 messages Apr 7, 2009 – Apr 9, 2009 ext2 file system

lore
Share & tools
lore
#0 lore raw

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

regards,
dan carpenter

fs/ext2/super.c +3 -1
@@ -1394,8 +1394,10 @@
 		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++;
#1 lore raw
Quoted 8 lines

The inode->i_mutex should be unlocked.

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

regards,
dan carpenter

Thanks for the fix. Merged into quota tree.

Honza

Quoted 19 lines
fs/ext2/super.c +3 -2
@@ -1394,8 +1394,10 @@
 		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 linux-ext4" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
Jan Kara <[email protected]>
SuSE CR Labs