From 4b87a81c86db06f6fe2bee440c65fc05cd4c23ce Mon Sep 17 00:00:00 2001 From: Vicente Cheng Date: Wed, 29 Oct 2014 12:21:11 +0800 Subject: [PATCH] rbd: Fix the rbd export when image size more than 2G When using export and the size of image is more than 2G, the previous version about finish() could not handle in seeking the offset in image and return error. This is caused by the incorrect variable type. Try to use the correct variable type to fixed it. I use another variable which type is uint64_t for confirming seeking and still use the previous r for return error. uint64_t is more better than type int for handle lseek64(). Signed-off-by: Vicente Cheng --- src/rbd.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rbd.cc b/src/rbd.cc index 2d52439c3efd1..26cb589dc1f1f 100644 --- a/src/rbd.cc +++ b/src/rbd.cc @@ -1056,8 +1056,8 @@ public: return; } - r = lseek64(m_fd, m_offset, SEEK_SET); - if (static_cast(r) != m_offset) { + uint64_t chkret = lseek64(m_fd, m_offset, SEEK_SET); + if (chkret != m_offset) { cerr << "rbd: error seeking destination image to offset " << m_offset << std::endl; r = -errno; -- 2.39.5