OSDN Git Service

libext2fs: fix ext2fs_llseek on i386
authorPhillip Susi <psusi@ubuntu.com>
Thu, 24 Jan 2013 16:21:56 +0000 (11:21 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 25 Jan 2013 04:04:01 +0000 (23:04 -0500)
commit274d46e1d35af423d0292d63c4d0ad7a03be82ba
tree16ff10087543f568104f9a8732a374432e119959
parent511ba985c0821d07a6274515e35cbf5a3c81077d
libext2fs: fix ext2fs_llseek on i386

ext2fs_llseek() was using lseek instead of lseek64.  The
only time it would use lseek64 is if passed an offset that
overflowed 32 bits.  This works for SEEK_SET, but not
SEEK_CUR, which can apply a small offset to move the file
pointer past the 32 bit limit.

The code has been changed to instead try lseek64 first, and
fall back to lseek if that fails.  It also was doing a
runtime check of the size of off_t.  This has been moved to
compile time.

This fixes a problem which would cause e2image when built for
x86-32 to bomb out when used with large file systems.

Signed-off-by: Phillip Susi <psusi@ubuntu.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
configure.in
lib/config.h.in
lib/ext2fs/llseek.c