From: Sage Weil Date: Mon, 1 Oct 2012 03:46:37 +0000 (-0700) Subject: filejournal: check lseek64 return value X-Git-Tag: v0.54~148 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=15ebc0ff1ea63aacea855a942a8e544b2c36a17f;p=ceph.git filejournal: check lseek64 return value CID 716858: Other violation (CHECKED_RETURN) At (6): Calling function "lseek64(this->fd, pos, 0)" without checking return value. This library function may fail and return an error code. Signed-off-by: Sage Weil --- diff --git a/src/os/FileJournal.cc b/src/os/FileJournal.cc index 22547208af46..34eab4e28c9c 100644 --- a/src/os/FileJournal.cc +++ b/src/os/FileJournal.cc @@ -1583,7 +1583,8 @@ void FileJournal::wrap_read_bl(off64_t& pos, int64_t olen, bufferlist& bl) #ifdef DARWIN ::lseek(fd, pos, SEEK_SET); #else - ::lseek64(fd, pos, SEEK_SET); + int64_t actual = ::lseek64(fd, pos, SEEK_SET); + assert(actual == pos); #endif bufferptr bp = buffer::create(len);