From 12ceff8329375e016e2635c0836ac7dfbe3818e7 Mon Sep 17 00:00:00 2001 From: sage Date: Sat, 16 Sep 2006 22:10:26 +0000 Subject: [PATCH] ... git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@865 29311d96-e01e-0410-9327-a35deaab8ce9 --- ceph/ebofs/Ebofs.cc | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/ceph/ebofs/Ebofs.cc b/ceph/ebofs/Ebofs.cc index a0d13e9bdd2f5..e31e3a1e04174 100644 --- a/ceph/ebofs/Ebofs.cc +++ b/ceph/ebofs/Ebofs.cc @@ -1320,19 +1320,23 @@ void Ebofs::alloc_write(Onode *on, on->map_extents(bh->start(), bh->length(), old); assert(old.size() == 1); - if (bc.bh_cancel_write(bh)) { - dout(10) << "alloc_write unallocated tx " << old[0] << ", canceled " << *bh << endl; - allocator.unallocate(old[0]); // release (into free) - alloc.insert(bh->start(), bh->length()); - } else { - if (bh->start() >= start && bh->end() <= start+len) { - dout(10) << "alloc_write released tx " << old[0] << ", couldn't cancel " << *bh << endl; - allocator.release(old[0]); // release (into limbo) + if (bh->start() >= start && bh->end() <= start+len) { + if (bc.bh_cancel_write(bh)) { + if (bh->length() == 1) + dout(-10) << "alloc_write unallocated tx " << old[0] << ", canceled " << *bh << endl; + allocator.unallocate(old[0]); // release (into free) alloc.insert(bh->start(), bh->length()); } else { - dout(10) << "alloc_write skipped tx " << old[0] << ", not entirely within " - << start << "~" << len << " and couldn't cancel " << *bh << endl; + if (bh->length() == 1) + dout(-10) << "alloc_write released tx " << old[0] << ", couldn't cancel " << *bh << endl; + allocator.release(old[0]); // release (into limbo) + alloc.insert(bh->start(), bh->length()); } + } else { + if (bh->length() == 1) + dout(-10) << "alloc_write skipped tx " << old[0] << ", not entirely within " + << start << "~" << len + << " bh " << *bh << endl; } } -- 2.39.5