]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: force setattr to MDS when caller's {uid,gid} are not the specified ones
authorYan, Zheng <zyan@redhat.com>
Fri, 14 Aug 2015 07:29:02 +0000 (15:29 +0800)
committerSage Weil <sage@redhat.com>
Thu, 1 Oct 2015 13:41:32 +0000 (09:41 -0400)
Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/client/Client.cc

index 9404d8f22233e78cf058fe6da32bc2a39ed3a3cd..a8159c1d2df16ad1b433bf5865e5a0a3fd8f2af3 100644 (file)
@@ -5792,6 +5792,12 @@ int Client::_setattr(Inode *in, struct stat *attr, int mask, int uid, int gid,
     return -EDQUOT;
   }
   // make the change locally?
+  if ((uid >= 0 && user_id >= 0 && uid != user_id) ||
+      (gid >= 0 && group_id >= 0 && gid != group_id)) {
+    if (!mask)
+      mask |= CEPH_SETATTR_CTIME;
+    goto force_request;
+  }
 
   if (!mask) {
     // caller just needs us to bump the ctime
@@ -5844,6 +5850,7 @@ int Client::_setattr(Inode *in, struct stat *attr, int mask, int uid, int gid,
   if (!mask)
     return 0;
 
+force_request:
   MetaRequest *req = new MetaRequest(CEPH_MDS_OP_SETATTR);
 
   filepath path;