From 41c6f4c32fb8c949b5b474317c4d7e10ade2000e 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 3df0b4c5c14a..d5738b21586a 100644 --- a/src/osdc/ObjectCacher.cc +++ b/src/osdc/ObjectCacher.cc @@ -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; -- 2.47.3