]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: ObjectCacher reads can hang when reading sparse files 2493/head
authorJason Dillaman <dillaman@redhat.com>
Mon, 15 Sep 2014 04:53:50 +0000 (00:53 -0400)
committerJason Dillaman <dillaman@redhat.com>
Mon, 15 Sep 2014 04:53:50 +0000 (00:53 -0400)
The pending read list was not properly flushed when empty objects
were read from a space file.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/osdc/ObjectCacher.cc

index 90bf03fd09b4530446efac7b689f612fcd63424d..93cede5b7b802daf606c3a35f3a0e136fb77a883 100644 (file)
@@ -709,6 +709,9 @@ void ObjectCacher::bh_read_finish(int64_t poolid, sobject_t oid, ceph_tid_t tid,
       }
     }
 
+    ls.splice(ls.end(), waitfor_read);
+    waitfor_read.clear();
+
     // apply to bh's!
     loff_t opos = start;
     while (true) {
@@ -763,9 +766,6 @@ void ObjectCacher::bh_read_finish(int64_t poolid, sobject_t oid, ceph_tid_t tid,
       loff_t oldpos = opos;
       opos = bh->end();
 
-      ls.splice(ls.end(), waitfor_read);
-      waitfor_read.clear();
-
       if (r == -ENOENT) {
        if (trust_enoent) {
          ldout(cct, 10) << "bh_read_finish removing " << *bh << dendl;