Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'ceph-for-4.13-rc4' of git://github.com/ceph/ceph-client

Pull ceph fixes from Ilya Dryomov:
"A bunch of fixes and follow-ups for -rc1 Luminous patches: issues with
->reencode_message() and last minute RADOS semantic changes in
v12.1.2"

* tag 'ceph-for-4.13-rc4' of git://github.com/ceph/ceph-client:
libceph: make RECOVERY_DELETES feature create a new interval
libceph: upmap semantic changes
crush: assume weight_set != null imples weight_set_size > 0
libceph: fallback for when there isn't a pool-specific choose_arg
libceph: don't call ->reencode_message() more than once per message
libceph: make encode_request_*() work with r_mempool requests

+52 -37
+1
include/linux/ceph/osd_client.h
··· 148 148 int size; 149 149 int min_size; 150 150 bool sort_bitwise; 151 + bool recovery_deletes; 151 152 152 153 unsigned int flags; /* CEPH_OSD_FLAG_* */ 153 154 bool paused;
+2
include/linux/ceph/osdmap.h
··· 272 272 u32 new_pg_num, 273 273 bool old_sort_bitwise, 274 274 bool new_sort_bitwise, 275 + bool old_recovery_deletes, 276 + bool new_recovery_deletes, 275 277 const struct ceph_pg *pgid); 276 278 bool ceph_osds_changed(const struct ceph_osds *old_acting, 277 279 const struct ceph_osds *new_acting,
+4
include/linux/ceph/rados.h
··· 158 158 #define CEPH_OSDMAP_NOTIERAGENT (1<<13) /* disable tiering agent */ 159 159 #define CEPH_OSDMAP_NOREBALANCE (1<<14) /* block osd backfill unless pg is degraded */ 160 160 #define CEPH_OSDMAP_SORTBITWISE (1<<15) /* use bitwise hobject_t sort */ 161 + #define CEPH_OSDMAP_REQUIRE_JEWEL (1<<16) /* require jewel for booting osds */ 162 + #define CEPH_OSDMAP_REQUIRE_KRAKEN (1<<17) /* require kraken for booting osds */ 163 + #define CEPH_OSDMAP_REQUIRE_LUMINOUS (1<<18) /* require l for booting osds */ 164 + #define CEPH_OSDMAP_RECOVERY_DELETES (1<<19) /* deletes performed during recovery instead of peering */ 161 165 162 166 /* 163 167 * The error code to return when an OSD can't handle a write
+1 -1
include/linux/crush/crush.h
··· 193 193 struct crush_choose_arg_map { 194 194 #ifdef __KERNEL__ 195 195 struct rb_node node; 196 - u64 choose_args_index; 196 + s64 choose_args_index; 197 197 #endif 198 198 struct crush_choose_arg *args; /*!< replacement for each bucket 199 199 in the crushmap */
+1 -1
net/ceph/crush/mapper.c
··· 306 306 const struct crush_choose_arg *arg, 307 307 int position) 308 308 { 309 - if (!arg || !arg->weight_set || arg->weight_set_size == 0) 309 + if (!arg || !arg->weight_set) 310 310 return bucket->item_weights; 311 311 312 312 if (position >= arg->weight_set_size)
+3 -3
net/ceph/messenger.c
··· 1287 1287 if (m->needs_out_seq) { 1288 1288 m->hdr.seq = cpu_to_le64(++con->out_seq); 1289 1289 m->needs_out_seq = false; 1290 - } 1291 1290 1292 - if (con->ops->reencode_message) 1293 - con->ops->reencode_message(m); 1291 + if (con->ops->reencode_message) 1292 + con->ops->reencode_message(m); 1293 + } 1294 1294 1295 1295 dout("prepare_write_message %p seq %lld type %d len %d+%d+%zd\n", 1296 1296 m, con->out_seq, le16_to_cpu(m->hdr.type),
+11 -3
net/ceph/osd_client.c
··· 1337 1337 bool legacy_change; 1338 1338 bool split = false; 1339 1339 bool sort_bitwise = ceph_osdmap_flag(osdc, CEPH_OSDMAP_SORTBITWISE); 1340 + bool recovery_deletes = ceph_osdmap_flag(osdc, 1341 + CEPH_OSDMAP_RECOVERY_DELETES); 1340 1342 enum calc_target_result ct_res; 1341 1343 int ret; 1342 1344 ··· 1401 1399 pi->pg_num, 1402 1400 t->sort_bitwise, 1403 1401 sort_bitwise, 1402 + t->recovery_deletes, 1403 + recovery_deletes, 1404 1404 &last_pgid)) 1405 1405 force_resend = true; 1406 1406 ··· 1425 1421 t->pg_num = pi->pg_num; 1426 1422 t->pg_num_mask = pi->pg_num_mask; 1427 1423 t->sort_bitwise = sort_bitwise; 1424 + t->recovery_deletes = recovery_deletes; 1428 1425 1429 1426 t->osd = acting.primary; 1430 1427 } ··· 1923 1918 } 1924 1919 1925 1920 ceph_encode_32(&p, req->r_attempts); /* retry_attempt */ 1926 - BUG_ON(p != end - 8); /* space for features */ 1921 + BUG_ON(p > end - 8); /* space for features */ 1927 1922 1928 1923 msg->hdr.version = cpu_to_le16(8); /* MOSDOp v8 */ 1929 1924 /* front_len is finalized in encode_request_finish() */ 1925 + msg->front.iov_len = p - msg->front.iov_base; 1926 + msg->hdr.front_len = cpu_to_le32(msg->front.iov_len); 1930 1927 msg->hdr.data_len = cpu_to_le32(data_len); 1931 1928 /* 1932 1929 * The header "data_off" is a hint to the receiver allowing it ··· 1944 1937 static void encode_request_finish(struct ceph_msg *msg) 1945 1938 { 1946 1939 void *p = msg->front.iov_base; 1940 + void *const partial_end = p + msg->front.iov_len; 1947 1941 void *const end = p + msg->front_alloc_len; 1948 1942 1949 1943 if (CEPH_HAVE_FEATURE(msg->con->peer_features, RESEND_ON_SPLIT)) { 1950 1944 /* luminous OSD -- encode features and be done */ 1951 - p = end - 8; 1945 + p = partial_end; 1952 1946 ceph_encode_64(&p, msg->con->peer_features); 1953 1947 } else { 1954 1948 struct { ··· 1992 1984 oid_len = p - oid; 1993 1985 1994 1986 tail = p; 1995 - tail_len = (end - p) - 8; 1987 + tail_len = partial_end - p; 1996 1988 1997 1989 p = msg->front.iov_base; 1998 1990 ceph_encode_copy(&p, &head.client_inc, sizeof(head.client_inc));
+29 -29
net/ceph/osdmap.c
··· 295 295 ret = decode_choose_arg(p, end, arg); 296 296 if (ret) 297 297 goto fail; 298 + 299 + if (arg->ids_size && 300 + arg->ids_size != c->buckets[bucket_index]->size) 301 + goto e_inval; 298 302 } 299 303 300 304 insert_choose_arg_map(&c->choose_args, arg_map); ··· 2082 2078 u32 new_pg_num, 2083 2079 bool old_sort_bitwise, 2084 2080 bool new_sort_bitwise, 2081 + bool old_recovery_deletes, 2082 + bool new_recovery_deletes, 2085 2083 const struct ceph_pg *pgid) 2086 2084 { 2087 2085 return !osds_equal(old_acting, new_acting) || ··· 2091 2085 old_size != new_size || 2092 2086 old_min_size != new_min_size || 2093 2087 ceph_pg_is_split(pgid, old_pg_num, new_pg_num) || 2094 - old_sort_bitwise != new_sort_bitwise; 2088 + old_sort_bitwise != new_sort_bitwise || 2089 + old_recovery_deletes != new_recovery_deletes; 2095 2090 } 2096 2091 2097 2092 static int calc_pg_rank(int osd, const struct ceph_osds *acting) ··· 2308 2301 } 2309 2302 } 2310 2303 2304 + /* 2305 + * Magic value used for a "default" fallback choose_args, used if the 2306 + * crush_choose_arg_map passed to do_crush() does not exist. If this 2307 + * also doesn't exist, fall back to canonical weights. 2308 + */ 2309 + #define CEPH_DEFAULT_CHOOSE_ARGS -1 2310 + 2311 2311 static int do_crush(struct ceph_osdmap *map, int ruleno, int x, 2312 2312 int *result, int result_max, 2313 2313 const __u32 *weight, int weight_max, 2314 - u64 choose_args_index) 2314 + s64 choose_args_index) 2315 2315 { 2316 2316 struct crush_choose_arg_map *arg_map; 2317 2317 int r; ··· 2327 2313 2328 2314 arg_map = lookup_choose_arg_map(&map->crush->choose_args, 2329 2315 choose_args_index); 2316 + if (!arg_map) 2317 + arg_map = lookup_choose_arg_map(&map->crush->choose_args, 2318 + CEPH_DEFAULT_CHOOSE_ARGS); 2330 2319 2331 2320 mutex_lock(&map->crush_workspace_mutex); 2332 2321 r = crush_do_rule(map->crush, ruleno, x, result, result_max, ··· 2440 2423 for (i = 0; i < pg->pg_upmap.len; i++) 2441 2424 raw->osds[i] = pg->pg_upmap.osds[i]; 2442 2425 raw->size = pg->pg_upmap.len; 2443 - return; 2426 + /* check and apply pg_upmap_items, if any */ 2444 2427 } 2445 2428 2446 2429 pg = lookup_pg_mapping(&osdmap->pg_upmap_items, pgid); 2447 2430 if (pg) { 2448 - /* 2449 - * Note: this approach does not allow a bidirectional swap, 2450 - * e.g., [[1,2],[2,1]] applied to [0,1,2] -> [0,2,1]. 2451 - */ 2452 - for (i = 0; i < pg->pg_upmap_items.len; i++) { 2453 - int from = pg->pg_upmap_items.from_to[i][0]; 2454 - int to = pg->pg_upmap_items.from_to[i][1]; 2455 - int pos = -1; 2456 - bool exists = false; 2431 + for (i = 0; i < raw->size; i++) { 2432 + for (j = 0; j < pg->pg_upmap_items.len; j++) { 2433 + int from = pg->pg_upmap_items.from_to[j][0]; 2434 + int to = pg->pg_upmap_items.from_to[j][1]; 2457 2435 2458 - /* make sure replacement doesn't already appear */ 2459 - for (j = 0; j < raw->size; j++) { 2460 - int osd = raw->osds[j]; 2461 - 2462 - if (osd == to) { 2463 - exists = true; 2436 + if (from == raw->osds[i]) { 2437 + if (!(to != CRUSH_ITEM_NONE && 2438 + to < osdmap->max_osd && 2439 + osdmap->osd_weight[to] == 0)) 2440 + raw->osds[i] = to; 2464 2441 break; 2465 2442 } 2466 - /* ignore mapping if target is marked out */ 2467 - if (osd == from && pos < 0 && 2468 - !(to != CRUSH_ITEM_NONE && 2469 - to < osdmap->max_osd && 2470 - osdmap->osd_weight[to] == 0)) { 2471 - pos = j; 2472 - } 2473 - } 2474 - if (!exists && pos >= 0) { 2475 - raw->osds[pos] = to; 2476 - return; 2477 2443 } 2478 2444 } 2479 2445 }