Signed-off-by: Yan, Zheng <zyan@redhat.com>
mds->mdlog->submit_entry(le, new C_MDC_TruncateLogged(this, in, mut));
// flush immediately if there are readers/writers waiting
- if (in->get_caps_wanted() & (CEPH_CAP_FILE_RD|CEPH_CAP_FILE_WR))
+ if (in->is_waiter_for(CInode::WAIT_TRUNC) ||
+ (in->get_caps_wanted() & (CEPH_CAP_FILE_RD|CEPH_CAP_FILE_WR)))
mds->mdlog->flush();
}
mds->locker->drop_locks(mdr.get());
mdr->drop_local_auth_pins();
cur->add_waiter(CInode::WAIT_TRUNC, new C_MDS_RetryRequest(mdcache, mdr));
- mds->mdlog->flush();
return;
}
}