summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Durgin <josh.durgin@dreamhost.com>2012-04-23 11:58:57 -0700
committerJosh Durgin <josh.durgin@dreamhost.com>2012-04-24 08:57:31 -0700
commite17b5a85be57a9e09768de2a9b0807457dd636b2 (patch)
tree07b2301482a922b3f155e429af0667a6d55de872
parent2bdaba4f01910c33cddb4f647f44c0c27b9b0317 (diff)
downloadceph-e17b5a85be57a9e09768de2a9b0807457dd636b2.tar.gz
librbd: clarify handle_sparse_read condition
The earlier condition is >. != means < at this point, and the nesting is unnecessary. Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
-rw-r--r--src/librbd.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/librbd.cc b/src/librbd.cc
index 752d92e325f..485f709664f 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)) {