OSDN Git Service

llseek: setup the correct seek for ext2fs_llseek
authorJP Abgrall <jpa@google.com>
Fri, 25 Mar 2016 16:00:07 +0000 (12:00 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 25 Mar 2016 16:00:18 +0000 (12:00 -0400)
commit5efe492d19ae6fc876b504a53621169f63f1ce96
tree9a23919bea6a8a6e0ef9ce4951340cc019abbbf8
parent3bf56ef62405332b07683a26e82109bacc378570
llseek: setup the correct seek for ext2fs_llseek

After
  http://git.kernel.org/cgit/fs/ext2/e2fsprogs.git/commit/lib/ext2fs/llseek.c?id=274d46e1d35af423d0292d63c4d0ad7a03be82ba

with
  __linux__
  defined(HAVE_LSEEK64) && defined(HAVE_LSEEK64_PROTOTYPE)
  SIZEOF_OFF_T >= SIZEOF_LONG_LONG
it leads to ext2fs_llseek() doing a "return lseek(fd, offset, origin);"
Which  fails for offsets > 32bit.

Also, with
  __linux__
  !(defined(HAVE_LSEEK64) && defined(HAVE_LSEEK64_PROTOTYPE))
  defined(HAVE_LLSEEK)
  SIZEOF_OFF_T == SIZEOF_LONG_LONG
my_llseek is not defined at all. And there is no need to define
llseek as lseek, as llseek is never used.
Luckily ext2fs_llseek() then does "return lseek(...);"
It would seem that my_llseek should be used in both places.

Addresses-Google-Bug: #13340735
Change-Id: Ie7330300c9c1ca103eaaef97536dcf10adbbba02
Signed-off-by: JP Abgrall <jpa@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/llseek.c