]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: broadcast quota message to client when disable quota 26293/head
authorJunhui Tang <tangjunhui@sangfor.com.cn>
Thu, 24 Jan 2019 08:33:58 +0000 (16:33 +0800)
committerPrashant D <pdhange@redhat.com>
Wed, 6 Feb 2019 00:44:56 +0000 (19:44 -0500)
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 <tangjunhui@sangfor.com.cn>
Fixes: https://tracker.ceph.com/issues/38054
(cherry picked from commit 061ace2eb7c08d271db4d5d08ffa91ae832715f5)

Conflicts:
src/mds/MDCache.cc : Resolved in broadcast_quota_to_client

src/mds/MDCache.cc
src/mds/MDCache.h
src/mds/Server.cc

index d7b40a3126f6522e7bfbf3a924ae1b114ddc69c4..b66dd1d2346f637d15ad6812e7dd025111a49505 100644 (file)
@@ -2015,14 +2015,15 @@ 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 (!in->is_auth() || in->is_frozen())
     return;
 
   auto i = in->get_projected_inode();
-
-  if (!i->quota.is_enable())
+  
+  if (!i->quota.is_enable() &&
+         !quota_change)
     return;
 
   for (map<client_t,Capability*>::iterator it = in->client_caps.begin();
index 49d8fc738c72d4ed952a9afd3043c184a8016f3d..1024a71125d56f5de659b3db861e12e129197651 100644 (file)
@@ -400,7 +400,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,
index e3fe19aa321d9c95491b5cdb83bc2079251a78d4..a5e72a7511bdf1730d1e5807d8e978c48c9850f9 100644 (file)
@@ -4827,7 +4827,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);