The previous patch would return EFBIG for any failure called from
ext2fs_get_device_size2(). (I didn't merge this fix with the
preceeding commit to allow merges to happen more easily.)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
{
errcode_t retval;
blk64_t blocks;
- retval = ext2fs_get_device_size2(file, blocksize, &blocks);
- if (!retval && blocks < (1ULL << 32)) {
- *retblocks = (blk_t) blocks;
+ retval = ext2fs_get_device_size2(file, blocksize, &blocks);
+ if (retval)
return retval;
- }
- return EFBIG;
+ if (blocks >= (1ULL << 32))
+ return EFBIG;
+ *retblocks = (blk_t) blocks;
+ return 0;
}
#endif /* WIN32 */