]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: prevent old clients from using tiered pools
authorSage Weil <sage@redhat.com>
Wed, 30 Jul 2014 20:57:34 +0000 (13:57 -0700)
committerSage Weil <sage@redhat.com>
Tue, 12 Aug 2014 22:13:21 +0000 (15:13 -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>
(cherry picked from commit 0190df53056834f219e33ada2af3a79e8c4dfb77)

src/osd/OpRequest.h
src/osd/ReplicatedPG.cc

index 569b6fc581ea37041592ea5fc177a35b2a5f3040..b074bee0295d70959a9b6a7c900c13355df5e068 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:
   osd_reqid_t reqid;
   uint8_t hit_flag_points;
index df3514754e85e3a34c6cdc81b869854fc6252765..0e9fc620911101fff2e30964382e9ae6ec698d59 100644 (file)
@@ -1120,6 +1120,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;