]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: prevent old clients from using tiered pools 2172/head
authorSage Weil <sage@redhat.com>
Wed, 30 Jul 2014 20:57:34 +0000 (13:57 -0700)
committerSage Weil <sage@redhat.com>
Wed, 30 Jul 2014 20:57:34 +0000 (13:57 -0700)
If the client is old and doesn't understand tiering, don't let them use a
tiered pool.  Reply with EOPNOTSUPP.

Fixes: #8714
Backport: firefly
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OpRequest.h
src/osd/ReplicatedPG.cc

index 11fa0e6148aa128b2713b6919f141ced0118700a..4c9795847b27086cdf220410b80fedea6f336286 100644 (file)
@@ -74,6 +74,10 @@ struct OpRequest : public TrackedOp {
 
   void _dump(utime_t now, Formatter *f) const;
 
+  bool has_feature(uint64_t f) const {
+    return request->get_connection()->has_feature(f);
+  }
+
 private:
   Message *request; /// the logical request we are tracking
   osd_reqid_t reqid;
index 4dae5d3fef2faf82c79320d8ae857c20a6ea01e7..646443badbf1600a83f9d16a4c2f2fe5fee79f76 100644 (file)
@@ -1116,6 +1116,12 @@ void ReplicatedPG::do_request(
       waiting_for_active.push_back(op);
       return;
     }
+    // verify client features
+    if ((pool.info.has_tiers() || pool.info.is_tier()) &&
+       !op->has_feature(CEPH_FEATURE_OSD_CACHEPOOL)) {
+      osd->reply_op_error(op, -EOPNOTSUPP);
+      return;
+    }
     do_op(op); // do it now
     break;