From 711a7e6f81983ff2091caa0f232af914a04a041c Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Mon, 15 Sep 2014 00:53:50 -0400 Subject: [PATCH] rbd: ObjectCacher reads can hang when reading sparse files The pending read list was not properly flushed when empty objects were read from a space file. Signed-off-by: Jason Dillaman (cherry picked from commit cdb7675a21c9107e3596c90c2b1598def3c6899f) --- src/osdc/ObjectCacher.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/osdc/ObjectCacher.cc b/src/osdc/ObjectCacher.cc index e804674ffe285..58fc6e5ca3466 100644 --- a/src/osdc/ObjectCacher.cc +++ b/src/osdc/ObjectCacher.cc @@ -710,6 +710,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) { @@ -764,9 +767,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; -- 2.39.5