]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: broadcast quota message to client when disable quota 26292/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:00:58 +0000 (19:00 -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)

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

index 97c3c9933813f0c23aba4516bfdb4ce1a20371d1..5df3d2cbfd91b7f907a80497cee86d4f9dbbecb7 100644 (file)
@@ -2025,7 +2025,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;
@@ -2034,7 +2034,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)
index b8633c4945fe15e63f0dd0ec99ea386edc83f369..31b7761b8eb9092359c7143f801e97915a5a4a92 100644 (file)
@@ -402,7 +402,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 4121083863514bfc8e48775ec6c97617e7a411f0..66807a286c668f6287672841f86e006d2c8110b1 100644 (file)
@@ -5057,7 +5057,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);