Try to broadcast quota to relevant clients proactively if quota is
explicitly set by someone, in case that client won't get quota update
for a long time.
Fixes: http://tracker.ceph.com/issues/24133
Signed-off-by: Zhi Zhang <zhangz.david@outlook.com>
(cherry picked from commit
b2a7643b102dbbb8221dcb8a785db5e4276ac284)
}
}
-void MDCache::broadcast_quota_to_client(CInode *in)
+void MDCache::broadcast_quota_to_client(CInode *in, client_t exclude_ct)
{
if (!(mds->is_active() || mds->is_stopping()))
return;
continue;
Capability *cap = it->second;
+
+ if (exclude_ct >= 0 && exclude_ct != it->first)
+ goto update;
+
if (cap->last_rbytes == i->rstat.rbytes &&
cap->last_rsize == i->rstat.rsize())
continue;
void project_rstat_frag_to_inode(nest_info_t& rstat, nest_info_t& accounted_rstat,
snapid_t ofirst, snapid_t last,
CInode *pin, bool cow_head);
- void broadcast_quota_to_client(CInode *in);
+ void broadcast_quota_to_client(CInode *in, client_t exclude_ct = -1);
void predirty_journal_parents(MutationRef mut, EMetaBlob *blob,
CInode *in, CDir *parent,
int flags, int linkunlink=0,
}
mdr->no_early_reply = true;
pip = &pi.inode;
+
+ client_t exclude_ct = mdr->get_client();
+ mdcache->broadcast_quota_to_client(cur, exclude_ct);
} else if (name.find("ceph.dir.pin") == 0) {
if (!cur->is_dir() || cur->is_root()) {
respond_to_request(mdr, -EINVAL);