]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: ObjectCacher reads can hang when reading sparse files
authorJason Dillaman <dillaman@redhat.com>
Mon, 15 Sep 2014 04:53:50 +0000 (00:53 -0400)
committerSage Weil <sage@redhat.com>
Fri, 3 Oct 2014 00:55:07 +0000 (17:55 -0700)
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>
(cherry picked from commit cdb7675a21c9107e3596c90c2b1598def3c6899f)

src/osdc/ObjectCacher.cc

index 3df0b4c5c14afa31aabe77351df2d81a66e6ada6..d5738b21586a1380faf61a5e03be37886d46fcaf 100644 (file)
@@ -708,6 +708,9 @@ void ObjectCacher::bh_read_finish(int64_t poolid, sobject_t oid, tid_t tid,
       }
     }
 
+    ls.splice(ls.end(), waitfor_read);
+    waitfor_read.clear();
+
     // apply to bh's!
     loff_t opos = start;
     while (true) {
@@ -762,9 +765,6 @@ void ObjectCacher::bh_read_finish(int64_t poolid, sobject_t oid, 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;