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);
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to