]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: share max size to client who is allowed for WR cap
authorYan, Zheng <zheng.z.yan@intel.com>
Tue, 15 Apr 2014 08:06:07 +0000 (16:06 +0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Tue, 15 Apr 2014 08:30:06 +0000 (16:30 +0800)
WR cap is allowed for the loner client when filelock is in excl->mix
state. MDS should share max size with the loner client in this case.
Otherwise the client may wait for the max size forever.

Fixes: #8092
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
src/mds/Locker.cc

index b24aec9bcfc6e2ce9e691d51db1d41b65d2e90e0..e5fe00c2a679404daef2c31d1cb1378c5cd82cea 100644 (file)
@@ -1674,7 +1674,8 @@ void Locker::file_update_finish(CInode *in, MutationRef& mut, bool share, client
       issue_caps(in, cap);
     }
   
-    if (share && in->is_auth() && in->filelock.is_stable())
+    if (share && in->is_auth() &&
+       (in->filelock.gcaps_allowed(CAP_LONER) & (CEPH_CAP_GWR|CEPH_CAP_GBUFFER)))
       share_inode_max_size(in);
   }
   issue_caps_set(need_issue);