svn commit: r245844 - head/sys/fs/ext2fs

Pedro F. Giffuni pfg at FreeBSD.org
Wed Jan 23 14:29:30 UTC 2013


Author: pfg
Date: Wed Jan 23 14:29:29 2013
New Revision: 245844
URL: http://svnweb.freebsd.org/changeset/base/245844

Log:
  ext2fs: fix a check for negative block numbers.
  
  The previous change accidentally left the substraction we
  were trying to avoid in case that i_blocks could become
  negative.
  
  Reported by:	bde
  MFC after:	4 days

Modified:
  head/sys/fs/ext2fs/ext2_inode.c

Modified: head/sys/fs/ext2fs/ext2_inode.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_inode.c	Wed Jan 23 14:14:13 2013	(r245843)
+++ head/sys/fs/ext2fs/ext2_inode.c	Wed Jan 23 14:29:29 2013	(r245844)
@@ -341,10 +341,9 @@ done:
 	 * Put back the real size.
 	 */
 	oip->i_size = length;
-	oip->i_blocks -= blocksreleased;
 	if (oip->i_blocks > blocksreleased)
 		oip->i_blocks -= blocksreleased;
-	else	/* sanity */
+	else			/* sanity */
 		oip->i_blocks = 0;
 	oip->i_flag |= IN_CHANGE;
 	vnode_pager_setsize(ovp, length);


More information about the svn-src-all mailing list