From: Mahati Chamarthy Date: Fri, 18 Sep 2020 07:22:25 +0000 (+0530) Subject: librbd/cache: Fix pwl_path read issue X-Git-Tag: v16.1.0~1013^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7ab199d2a79ead6068fdb758b369647ee0d9fe39;p=ceph.git librbd/cache: Fix pwl_path read issue ... in ImageCacheState Signed-off-by: Mahati Chamarthy --- diff --git a/src/librbd/cache/pwl/ImageCacheState.cc b/src/librbd/cache/pwl/ImageCacheState.cc index 1aa9c73a7ec6..5f2ac52f0dd9 100644 --- a/src/librbd/cache/pwl/ImageCacheState.cc +++ b/src/librbd/cache/pwl/ImageCacheState.cc @@ -53,10 +53,10 @@ ImageCacheState::ImageCacheState( present = (bool)f["present"]; empty = (bool)f["empty"]; clean = (bool)f["clean"]; - host = (string)f["rwl_host"]; - path = (string)f["rwl_path"]; + host = (string)f["pwl_host"]; + path = (string)f["pwl_path"]; uint64_t pwl_size; - std::istringstream iss(f["rwl_size"]); + std::istringstream iss(f["pwl_size"]); iss >> pwl_size; size = pwl_size; diff --git a/src/test/librbd/cache/test_mock_ReplicatedWriteLog.cc b/src/test/librbd/cache/test_mock_ReplicatedWriteLog.cc index 4e9f8065ae4c..6027b28a2074 100644 --- a/src/test/librbd/cache/test_mock_ReplicatedWriteLog.cc +++ b/src/test/librbd/cache/test_mock_ReplicatedWriteLog.cc @@ -156,9 +156,9 @@ TEST_F(TestMockCacheReplicatedWriteLog, init_state_json_write) { JSONFormattable f; string strf = "{ \"present\": \"1\", \"empty\": \"0\", \"clean\": \"0\", \ - \"rwl_host\": \"testhost\", \ - \"rwl_path\": \"/tmp\", \ - \"rwl_size\": \"1024\" }"; + \"pwl_host\": \"testhost\", \ + \"pwl_path\": \"/tmp\", \ + \"pwl_size\": \"1024\" }"; get_jf(strf, &f); MockImageCacheStateRWL image_cache_state(&mock_image_ctx, f);