On an x86_64 machine, creating a 3 GB ZFS-based target using a file
VDev failed like this:
mkfs.lustre FATAL: mkfs.lustre: Unable to truncate backing store:
Invalid argument
The error, returned by the ftruncate() call in file_create(), was due
to the "int"-type calculation for the "off_t" argument. The byte
number of 3 GB overflowed the "int" type and became a negative
"off_t". This patch changes file_create() to take an "__u64" size
instead of an "int" one and adds "_FILE_OFFSET_BITS=64" to the
AM_CPPFLAGS of lustre/utils, so that file VDevs larger than 2 GB can
be created on both 32-bit and 64-bit x86 architectures.
Change-Id: Id7e6bfc963b0ccba8266795ba2bf9832e9c641ba
Signed-off-by: Li Wei <wei.g.li@intel.com>
Reviewed-on: http://review.whamcloud.com/5805
Tested-by: Hudson
Reviewed-by: Fan Yong <fan.yong@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>