mirror of
https://github.com/ceph/ceph
synced 2025-02-23 02:57:21 +00:00
FileJournal: check return value of lseek in write_fd
CID 716859: Other violation (CHECKED_RETURN)At (1): Calling function "lseek64(this->fd, pos, 0)" without checking return value. This library function may fail and return an error code. Signed-off-by: Samuel Just <sam.just@inktank.com>
This commit is contained in:
parent
5c8aea783a
commit
8ec08c2dae
@ -946,8 +946,13 @@ int FileJournal::write_bl(off64_t& pos, bufferlist& bl)
|
||||
{
|
||||
align_bl(pos, bl);
|
||||
|
||||
::lseek64(fd, pos, SEEK_SET);
|
||||
int ret = bl.write_fd(fd);
|
||||
int ret = ::lseek64(fd, pos, SEEK_SET);
|
||||
if (ret) {
|
||||
ret = -errno;
|
||||
derr << "FileJournal::write_bl : lseek64 failed " << cpp_strerror(ret) << dendl;
|
||||
return ret;
|
||||
}
|
||||
ret = bl.write_fd(fd);
|
||||
if (ret) {
|
||||
derr << "FileJournal::write_bl : write_fd failed: " << cpp_strerror(ret) << dendl;
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user