From d70b71aa2f87013975d7fee16be549bf24944b72 Mon Sep 17 00:00:00 2001 From: myoungwon oh Date: Wed, 13 Dec 2017 13:38:39 +0900 Subject: [PATCH] osd: fix unordered read bug (for chunked object) The current implementation for chunked object only supports proxy_read(if offset is within range) and write(local write) In this case, a read request can be handled before a write request. This commit prevents unordered read processing because proxy_read() will be executed if the chunk is missing state. If chunked object has been overwritten, its state will not be missing. Fixes: http://tracker.ceph.com/issues/22369 Signed-off-by: Myoungwon Oh --- src/osd/PrimaryLogPG.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 2fb52543e1e..a19ce05f2f8 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -3214,6 +3214,9 @@ bool PrimaryLogPG::can_proxy_chunked_read(OpRequestRef op, ObjectContextRef obc) /* requested chunks exist in chunk_map ? */ for (auto &p : obc->obs.oi.manifest.chunk_map) { if (p.first <= cursor && p.first + p.second.length > cursor) { + if (p.second.flags != chunk_info_t::FLAG_MISSING) { + return false; + } if (p.second.length >= remain) { remain = 0; break; -- 2.39.5