FileJournal: correctly check return value of lseek in write_fd
PATCH 1/1 FileJournal: correctly check return value of lseek in write_fd
Signed-off-by Jim Schutt <[email protected]>
--- src/os/FileJournal.cc | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
src/os/FileJournal.cc +3 -2
@@ -945,9 +945,10 @@ void FileJournal::align_bl(off64_t pos, bufferlist& bl) int FileJournal::write_bl(off64_t& pos, bufferlist& bl) { align_bl(pos, bl); + int ret; - int ret = ::lseek64(fd, pos, SEEK_SET); - if (ret) { + off64_t spos = ::lseek64(fd, pos, SEEK_SET); + if (spos < 0) { ret = -errno; derr << "FileJournal::write_bl : lseek64 failed " << cpp_strerror(ret) << dendl; return ret;
Signature · 1 line
1.7.8.2