From: Junhui Tang Date: Thu, 24 Jan 2019 08:33:58 +0000 (+0800) Subject: mds: broadcast quota message to client when disable quota X-Git-Tag: v14.1.0~211^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=061ace2eb7c08d271db4d5d08ffa91ae832715f5;p=ceph-ci.git mds: broadcast quota message to client when disable quota When disable quota by setting quota.max_files or quota.max_bytes to zero, client does not receive the quota broadcast message. Signed-off-by: Junhui Tang Fixes: https://tracker.ceph.com/issues/38054 --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 41c652cfea5..81ec599d88e 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -1990,7 +1990,7 @@ void MDCache::project_rstat_frag_to_inode(nest_info_t& rstat, nest_info_t& accou } } -void MDCache::broadcast_quota_to_client(CInode *in, client_t exclude_ct) +void MDCache::broadcast_quota_to_client(CInode *in, client_t exclude_ct, bool quota_change) { if (!(mds->is_active() || mds->is_stopping())) return; @@ -1999,7 +1999,9 @@ void MDCache::broadcast_quota_to_client(CInode *in, client_t exclude_ct) return; auto i = in->get_projected_inode(); - if (!i->quota.is_enable()) + + if (!i->quota.is_enable() && + !quota_change) return; // creaete snaprealm for quota inode (quota was set before mimic) diff --git a/src/mds/MDCache.h b/src/mds/MDCache.h index 1bbefffdcb4..cae2db87d1e 100644 --- a/src/mds/MDCache.h +++ b/src/mds/MDCache.h @@ -399,7 +399,7 @@ public: 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, client_t exclude_ct = -1); + void broadcast_quota_to_client(CInode *in, client_t exclude_ct = -1, bool quota_change = false); void predirty_journal_parents(MutationRef mut, EMetaBlob *blob, CInode *in, CDir *parent, int flags, int linkunlink=0, diff --git a/src/mds/Server.cc b/src/mds/Server.cc index a26bdd88380..137a97db8e4 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -5194,7 +5194,7 @@ void Server::handle_set_vxattr(MDRequestRef& mdr, CInode *cur, pip = &pi.inode; client_t exclude_ct = mdr->get_client(); - mdcache->broadcast_quota_to_client(cur, exclude_ct); + mdcache->broadcast_quota_to_client(cur, exclude_ct, true); } else if (name.find("ceph.dir.pin") == 0) { if (!cur->is_dir() || cur->is_root()) { respond_to_request(mdr, -EINVAL);