]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
uclient: only try to update caps on the auth MDS.
authorGreg Farnum <gregory.farnum@dreamhost.com>
Wed, 4 May 2011 17:47:43 +0000 (10:47 -0700)
committerGreg Farnum <gregory.farnum@dreamhost.com>
Wed, 4 May 2011 17:50:41 +0000 (10:50 -0700)
Previously we would send updates on things like the max_size we
wanted to the first MDS in our list, which was bad if the auth mds
had a higher number. Now, only send them (and update bookkeeping)
for the auth MDS.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
src/client/Client.cc

index 13c39b9928a23b184d276c4f27e1a49ab754e86c..28fc47c67863294fa66266e96c0396f0d12339bc 100644 (file)
@@ -1903,9 +1903,11 @@ void Client::send_cap(Inode *in, int mds, InodeCap *cap, int used, int want, int
   m->head.time_warp_seq = in->time_warp_seq;
     
   in->reported_size = in->size;
-  m->set_max_size(in->wanted_max_size);
-  in->requested_max_size = in->wanted_max_size;
   m->set_snap_follows(in->snaprealm->get_snap_context().seq);
+  if (cap == in->auth_cap) {
+    m->set_max_size(in->wanted_max_size);
+    in->requested_max_size = in->wanted_max_size;
+  }
   messenger->send_message(m, mdsmap->get_inst(mds));
 }
 
@@ -1960,13 +1962,15 @@ void Client::check_caps(Inode *in, bool is_delayed)
             << " revoking " << ccap_string(revoking) << dendl;
 
     if (in->wanted_max_size > in->max_size &&
-       in->wanted_max_size > in->requested_max_size)
+       in->wanted_max_size > in->requested_max_size &&
+       cap == in->auth_cap)
       goto ack;
 
     /* approaching file_max? */
     if ((cap->issued & CEPH_CAP_FILE_WR) &&
        (in->size << 1) >= in->max_size &&
-       (in->reported_size << 1) < in->max_size) {
+       (in->reported_size << 1) < in->max_size &&
+       cap == in->auth_cap) {
       dout(10) << "size " << in->size << " approaching max_size " << in->max_size
               << ", reported " << in->reported_size << dendl;
       goto ack;