]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: fix offset overflow on Windows
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Thu, 21 Jan 2021 12:13:04 +0000 (12:13 +0000)
committerJason Dillaman <dillaman@redhat.com>
Tue, 26 Jan 2021 14:52:55 +0000 (09:52 -0500)
The rbd-wnbd daemon overflows when writing passed 4GB as the
offset field incorrectly uses uint32_t (initial versions of the
rbd-wnbd proposal used block increments).

This change updates the IO offset type to use uint64_t.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
(cherry picked from commit 784e0356cac3dbf4935ef5afe088d98e4a3577d8)

src/tools/rbd_wnbd/wnbd_handler.h

index 3fcdbdd5a11a2949392185882a67a2d247bb4788..a5c042f58026d900b9b4e5b9da269c86fa737b7a 100644 (file)
@@ -128,8 +128,8 @@ private:
     WnbdRequestType req_type = WnbdReqTypeUnknown;
     uint64_t req_handle = 0;
     uint32_t err_code = 0;
-    uint32_t req_size;
-    uint32_t req_from;
+    size_t req_size;
+    uint64_t req_from;
     bufferlist data;
 
     IOContext()