summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2013-01-23 14:29:29 +0000
committerpfg <pfg@FreeBSD.org>2013-01-23 14:29:29 +0000
commitf4f6188cae70e7f0590b4a22d4ea680b9434fc6c (patch)
treecf37737357fc7ff831f1fec67cc4641613f6722f
parent107e0c39a85867841fc50b7f302276228d36d632 (diff)
downloadFreeBSD-src-f4f6188cae70e7f0590b4a22d4ea680b9434fc6c.zip
FreeBSD-src-f4f6188cae70e7f0590b4a22d4ea680b9434fc6c.tar.gz
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
-rw-r--r--sys/fs/ext2fs/ext2_inode.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/fs/ext2fs/ext2_inode.c b/sys/fs/ext2fs/ext2_inode.c
index b2feaa1..82a3782 100644
--- a/sys/fs/ext2fs/ext2_inode.c
+++ b/sys/fs/ext2fs/ext2_inode.c
@@ -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);
OpenPOWER on IntegriCloud