]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: clarify handle_sparse_read condition
authorJosh Durgin <josh.durgin@dreamhost.com>
Mon, 23 Apr 2012 18:58:57 +0000 (11:58 -0700)
committerJosh Durgin <josh.durgin@dreamhost.com>
Tue, 24 Apr 2012 15:57:31 +0000 (08:57 -0700)
The earlier condition is >. != means < at this point, and the nesting
is unnecessary.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
src/librbd.cc

index 752d92e325f5a22ecdc6f80778bca52aab03d5f9..485f709664f2b95c65ddf64906bca9835bd5c461 100644 (file)
@@ -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)) {