diff options
author | pfg <pfg@FreeBSD.org> | 2013-01-23 14:29:29 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2013-01-23 14:29:29 +0000 |
commit | f4f6188cae70e7f0590b4a22d4ea680b9434fc6c (patch) | |
tree | cf37737357fc7ff831f1fec67cc4641613f6722f /sys/fs/ext2fs | |
parent | 107e0c39a85867841fc50b7f302276228d36d632 (diff) | |
download | FreeBSD-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
Diffstat (limited to 'sys/fs/ext2fs')
-rw-r--r-- | sys/fs/ext2fs/ext2_inode.c | 3 |
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); |