From: Yan, Zheng Date: Mon, 14 May 2018 11:50:19 +0000 (+0800) Subject: Revert "ceph-fuse: Delete inode's bufferhead was in Tx state would lead a assert... X-Git-Tag: v14.0.0~136^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=20e02a542f1c829a7c821326afe452ece97e5a99;p=ceph.git Revert "ceph-fuse: Delete inode's bufferhead was in Tx state would lead a assert fail" This reverts commit 07e3bceea78dc8ecd76abb1cafca5c9d1fde521e. Signed-off-by: "Yan, Zheng" --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 480ed5088ad6..2a6c5402c7c8 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -3739,7 +3739,7 @@ void Client::_invalidate_inode_cache(Inode *in, int64_t off, int64_t len) if (cct->_conf->client_oc) { vector ls; Striper::file_to_extents(cct, in->ino, &in->layout, off, len, in->truncate_size, ls); - objectcacher->discard_writeback(&in->oset, ls, nullptr); + objectcacher->discard_set(&in->oset, ls); } _schedule_invalidate_callback(in, off, len); diff --git a/src/osdc/ObjectCacher.cc b/src/osdc/ObjectCacher.cc index 711e71fc99a0..50f9a8d6a6c0 100644 --- a/src/osdc/ObjectCacher.cc +++ b/src/osdc/ObjectCacher.cc @@ -609,8 +609,7 @@ void ObjectCacher::Object::discard(loff_t off, loff_t len, bh->bl.clear(); bh->set_nocache(true); oc->mark_zero(bh); - // we should mark all Rx bh to zero - continue; + return; } else { assert(bh->waitfor_read.empty()); } @@ -2490,8 +2489,8 @@ void ObjectCacher::discard_writeback(ObjectSet *oset, if (gather.has_subs()) { gather.set_finisher(new FunctionContext( - [this, oset, on_finish](int) { - _discard_finish(oset, false, on_finish); + [this, oset, was_dirty, on_finish](int) { + _discard_finish(oset, was_dirty, on_finish); })); gather.activate(); return;