From: xie xingguo Date: Mon, 4 Jan 2016 03:29:12 +0000 (+0800) Subject: os: fix return code of _do_copy_range X-Git-Tag: v10.0.3~82^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=485e5865f05e34358f579cade5213a2024fc74f8;p=ceph.git os: fix return code of _do_copy_range Shall return a negative return code instead, otherwise caller will unable to handle it. Fixes: #14194 Signed-off-by: xie xingguo --- diff --git a/src/os/filestore/FileStore.cc b/src/os/filestore/FileStore.cc index 6601f8be6a4f..57bde5710279 100644 --- a/src/os/filestore/FileStore.cc +++ b/src/os/filestore/FileStore.cc @@ -3436,7 +3436,7 @@ int FileStore::_do_copy_range(int from, int to, uint64_t srcoff, uint64_t len, u if (backend->has_splice()) { int pipefd[2]; if (pipe(pipefd) < 0) { - r = errno; + r = -errno; derr << " pipe " << " got " << cpp_strerror(r) << dendl; return r; } @@ -3477,13 +3477,13 @@ int FileStore::_do_copy_range(int from, int to, uint64_t srcoff, uint64_t len, u actual = ::lseek64(from, srcoff, SEEK_SET); if (actual != (int64_t)srcoff) { - r = errno; + r = -errno; derr << "lseek64 to " << srcoff << " got " << cpp_strerror(r) << dendl; return r; } actual = ::lseek64(to, dstoff, SEEK_SET); if (actual != (int64_t)dstoff) { - r = errno; + r = -errno; derr << "lseek64 to " << dstoff << " got " << cpp_strerror(r) << dendl; return r; }