diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2013-10-07 09:51:48 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2013-10-07 09:51:48 -0400 |
commit | 4dbfd79d1458ce1259b951377e341aeb6197f8c1 (patch) | |
tree | 686b661a8fbdcb55345b50faa1207a5fcca1f6d8 /e2fsck/pass3.c | |
parent | 581646b94f3b57a461105968b49105a1357216ea (diff) | |
download | e2fsprogs-4dbfd79d1458ce1259b951377e341aeb6197f8c1.tar.gz |
e2fsprogs: fix blk_t <- blk64_t assignment mismatches
Fix all the places where we should be using a blk64_t instead of a
blk_t. These fixes are more severe because 64bit values could be
truncated silently.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'e2fsck/pass3.c')
-rw-r--r-- | e2fsck/pass3.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/e2fsck/pass3.c b/e2fsck/pass3.c index 565b8e33..e358bb20 100644 --- a/e2fsck/pass3.c +++ b/e2fsck/pass3.c @@ -758,6 +758,7 @@ errcode_t e2fsck_expand_directory(e2fsck_t ctx, ext2_ino_t dir, errcode_t retval; struct expand_dir_struct es; struct ext2_inode inode; + blk64_t sz; if (!(fs->flags & EXT2_FLAG_RW)) return EXT2_ET_RO_FILSYS; @@ -792,7 +793,9 @@ errcode_t e2fsck_expand_directory(e2fsck_t ctx, ext2_ino_t dir, if (retval) return retval; - inode.i_size = (es.last_block + 1) * fs->blocksize; + sz = (es.last_block + 1) * fs->blocksize; + inode.i_size = sz; + inode.i_size_high = sz >> 32; ext2fs_iblk_add_blocks(fs, &inode, es.newblocks); quota_data_add(ctx->qctx, &inode, dir, es.newblocks * fs->blocksize); |