From: Josh Durgin Date: Mon, 23 Apr 2012 18:58:57 +0000 (-0700) Subject: librbd: clarify handle_sparse_read condition X-Git-Tag: v0.46~14^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e17b5a85be57a9e09768de2a9b0807457dd636b2;p=ceph.git librbd: clarify handle_sparse_read condition The earlier condition is >. != means < at this point, and the nesting is unnecessary. Signed-off-by: Josh Durgin --- diff --git a/src/librbd.cc b/src/librbd.cc index 752d92e325f5..485f709664f2 100644 --- a/src/librbd.cc +++ b/src/librbd.cc @@ -1701,11 +1701,9 @@ ssize_t handle_sparse_read(CephContext *cct, buf_ofs += gap; buf_left -= gap; block_ofs = extent_ofs; - } else { - if (extent_ofs != block_ofs) { - assert(0 == "osd returned data prior to what we asked for"); - return -EIO; - } + } else if (extent_ofs < block_ofs) { + assert(0 == "osd returned data prior to what we asked for"); + return -EIO; } if (bl_ofs + extent_len > (buf_ofs + buf_left)) {