aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlya Dryomov <ilya.dryomov@inktank.com>2013-12-24 14:19:24 -0500
committerIlya Dryomov <ilya.dryomov@inktank.com>2013-12-31 13:32:09 -0500
commit2b3e0c905af43cfe402a2ef3f800be5dc1684005 (patch)
treec55a1ab35c2fae59429e33acbd5dcd61f24a8a01
parent12b4629a9fb80fecaebadc217b13b8776ed8dbef (diff)
libceph: update ceph_features.h
This updates ceph_features.h so that it has all feature bits defined in ceph.git. In the interim since the last update, ceph.git crossed the "32 feature bits" point, and, the addition of the 33rd bit wasn't handled correctly. The work-around is squashed into this commit and reflects ceph.git commit 053659d05e0349053ef703b414f44965f368b9f0. Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
-rw-r--r--include/linux/ceph/ceph_features.h96
-rw-r--r--net/ceph/messenger.c4
2 files changed, 67 insertions, 33 deletions
diff --git a/include/linux/ceph/ceph_features.h b/include/linux/ceph/ceph_features.h
index 4c42080347af..003ea719be65 100644
--- a/include/linux/ceph/ceph_features.h
+++ b/include/linux/ceph/ceph_features.h
@@ -4,42 +4,73 @@
4/* 4/*
5 * feature bits 5 * feature bits
6 */ 6 */
7#define CEPH_FEATURE_UID (1<<0) 7#define CEPH_FEATURE_UID (1ULL<<0)
8#define CEPH_FEATURE_NOSRCADDR (1<<1) 8#define CEPH_FEATURE_NOSRCADDR (1ULL<<1)
9#define CEPH_FEATURE_MONCLOCKCHECK (1<<2) 9#define CEPH_FEATURE_MONCLOCKCHECK (1ULL<<2)
10#define CEPH_FEATURE_FLOCK (1<<3) 10#define CEPH_FEATURE_FLOCK (1ULL<<3)
11#define CEPH_FEATURE_SUBSCRIBE2 (1<<4) 11#define CEPH_FEATURE_SUBSCRIBE2 (1ULL<<4)
12#define CEPH_FEATURE_MONNAMES (1<<5) 12#define CEPH_FEATURE_MONNAMES (1ULL<<5)
13#define CEPH_FEATURE_RECONNECT_SEQ (1<<6) 13#define CEPH_FEATURE_RECONNECT_SEQ (1ULL<<6)
14#define CEPH_FEATURE_DIRLAYOUTHASH (1<<7) 14#define CEPH_FEATURE_DIRLAYOUTHASH (1ULL<<7)
15#define CEPH_FEATURE_OBJECTLOCATOR (1<<8) 15#define CEPH_FEATURE_OBJECTLOCATOR (1ULL<<8)
16#define CEPH_FEATURE_PGID64 (1<<9) 16#define CEPH_FEATURE_PGID64 (1ULL<<9)
17#define CEPH_FEATURE_INCSUBOSDMAP (1<<10) 17#define CEPH_FEATURE_INCSUBOSDMAP (1ULL<<10)
18#define CEPH_FEATURE_PGPOOL3 (1<<11) 18#define CEPH_FEATURE_PGPOOL3 (1ULL<<11)
19#define CEPH_FEATURE_OSDREPLYMUX (1<<12) 19#define CEPH_FEATURE_OSDREPLYMUX (1ULL<<12)
20#define CEPH_FEATURE_OSDENC (1<<13) 20#define CEPH_FEATURE_OSDENC (1ULL<<13)
21#define CEPH_FEATURE_OMAP (1<<14) 21#define CEPH_FEATURE_OMAP (1ULL<<14)
22#define CEPH_FEATURE_MONENC (1<<15) 22#define CEPH_FEATURE_MONENC (1ULL<<15)
23#define CEPH_FEATURE_QUERY_T (1<<16) 23#define CEPH_FEATURE_QUERY_T (1ULL<<16)
24#define CEPH_FEATURE_INDEP_PG_MAP (1<<17) 24#define CEPH_FEATURE_INDEP_PG_MAP (1ULL<<17)
25#define CEPH_FEATURE_CRUSH_TUNABLES (1<<18) 25#define CEPH_FEATURE_CRUSH_TUNABLES (1ULL<<18)
26#define CEPH_FEATURE_CHUNKY_SCRUB (1<<19) 26#define CEPH_FEATURE_CHUNKY_SCRUB (1ULL<<19)
27#define CEPH_FEATURE_MON_NULLROUTE (1<<20) 27#define CEPH_FEATURE_MON_NULLROUTE (1ULL<<20)
28#define CEPH_FEATURE_MON_GV (1<<21) 28#define CEPH_FEATURE_MON_GV (1ULL<<21)
29#define CEPH_FEATURE_BACKFILL_RESERVATION (1<<22) 29#define CEPH_FEATURE_BACKFILL_RESERVATION (1ULL<<22)
30#define CEPH_FEATURE_MSG_AUTH (1<<23) 30#define CEPH_FEATURE_MSG_AUTH (1ULL<<23)
31#define CEPH_FEATURE_RECOVERY_RESERVATION (1<<24) 31#define CEPH_FEATURE_RECOVERY_RESERVATION (1ULL<<24)
32#define CEPH_FEATURE_CRUSH_TUNABLES2 (1<<25) 32#define CEPH_FEATURE_CRUSH_TUNABLES2 (1ULL<<25)
33#define CEPH_FEATURE_CREATEPOOLID (1<<26) 33#define CEPH_FEATURE_CREATEPOOLID (1ULL<<26)
34#define CEPH_FEATURE_REPLY_CREATE_INODE (1<<27) 34#define CEPH_FEATURE_REPLY_CREATE_INODE (1ULL<<27)
35#define CEPH_FEATURE_OSD_HBMSGS (1<<28) 35#define CEPH_FEATURE_OSD_HBMSGS (1ULL<<28)
36#define CEPH_FEATURE_MDSENC (1<<29) 36#define CEPH_FEATURE_MDSENC (1ULL<<29)
37#define CEPH_FEATURE_OSDHASHPSPOOL (1<<30) 37#define CEPH_FEATURE_OSDHASHPSPOOL (1ULL<<30)
38#define CEPH_FEATURE_MON_SINGLE_PAXOS (1ULL<<31)
39#define CEPH_FEATURE_OSD_SNAPMAPPER (1ULL<<32)
40#define CEPH_FEATURE_MON_SCRUB (1ULL<<33)
41#define CEPH_FEATURE_OSD_PACKED_RECOVERY (1ULL<<34)
42#define CEPH_FEATURE_OSD_CACHEPOOL (1ULL<<35)
43#define CEPH_FEATURE_CRUSH_V2 (1ULL<<36) /* new indep; SET_* steps */
44#define CEPH_FEATURE_EXPORT_PEER (1ULL<<37)
45#define CEPH_FEATURE_OSD_ERASURE_CODES (1ULL<<38)
46
47/*
48 * The introduction of CEPH_FEATURE_OSD_SNAPMAPPER caused the feature
49 * vector to evaluate to 64 bit ~0. To cope, we designate 1ULL << 63
50 * to mean 33 bit ~0, and introduce a helper below to do the
51 * translation.
52 *
53 * This was introduced by ceph.git commit
54 * 9ea02b84104045c2ffd7e7f4e7af512953855ecd v0.58-657-g9ea02b8
55 * and fixed by ceph.git commit
56 * 4255b5c2fb54ae40c53284b3ab700fdfc7e61748 v0.65-263-g4255b5c
57 */
58#define CEPH_FEATURE_RESERVED (1ULL<<63)
59
60static inline u64 ceph_sanitize_features(u64 features)
61{
62 if (features & CEPH_FEATURE_RESERVED) {
63 /* everything through OSD_SNAPMAPPER */
64 return 0x1ffffffffull;
65 } else {
66 return features;
67 }
68}
38 69
39/* 70/*
40 * Features supported. 71 * Features supported.
41 */ 72 */
42#define CEPH_FEATURES_SUPPORTED_DEFAULT \ 73#define CEPH_FEATURES_SUPPORTED_DEFAULT \
43 (CEPH_FEATURE_NOSRCADDR | \ 74 (CEPH_FEATURE_NOSRCADDR | \
44 CEPH_FEATURE_RECONNECT_SEQ | \ 75 CEPH_FEATURE_RECONNECT_SEQ | \
45 CEPH_FEATURE_PGID64 | \ 76 CEPH_FEATURE_PGID64 | \
@@ -56,4 +87,5 @@
56 CEPH_FEATURE_PGID64 | \ 87 CEPH_FEATURE_PGID64 | \
57 CEPH_FEATURE_PGPOOL3 | \ 88 CEPH_FEATURE_PGPOOL3 | \
58 CEPH_FEATURE_OSDENC) 89 CEPH_FEATURE_OSDENC)
90
59#endif 91#endif
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 260670558746..bd172e1ee0ae 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -15,6 +15,7 @@
15#include <linux/dns_resolver.h> 15#include <linux/dns_resolver.h>
16#include <net/tcp.h> 16#include <net/tcp.h>
17 17
18#include <linux/ceph/ceph_features.h>
18#include <linux/ceph/libceph.h> 19#include <linux/ceph/libceph.h>
19#include <linux/ceph/messenger.h> 20#include <linux/ceph/messenger.h>
20#include <linux/ceph/decode.h> 21#include <linux/ceph/decode.h>
@@ -1945,7 +1946,8 @@ static int process_connect(struct ceph_connection *con)
1945{ 1946{
1946 u64 sup_feat = con->msgr->supported_features; 1947 u64 sup_feat = con->msgr->supported_features;
1947 u64 req_feat = con->msgr->required_features; 1948 u64 req_feat = con->msgr->required_features;
1948 u64 server_feat = le64_to_cpu(con->in_reply.features); 1949 u64 server_feat = ceph_sanitize_features(
1950 le64_to_cpu(con->in_reply.features));
1949 int ret; 1951 int ret;
1950 1952
1951 dout("process_connect on %p tag %d\n", con, (int)con->in_tag); 1953 dout("process_connect on %p tag %d\n", con, (int)con->in_tag);