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.12-rc3' of git://github.com/ceph/ceph-client

Pul ceph fixes from Ilya Dryomov:
"A bunch of make W=1 and static checker fixups, a RECONNECT_SEQ
messenger patch from Zheng and Luis' fallocate fix"

* tag 'ceph-for-4.12-rc3' of git://github.com/ceph/ceph-client:
ceph: check that the new inode size is within limits in ceph_fallocate()
libceph: cleanup old messages according to reconnect seq
libceph: NULL deref on crush_decode() error path
libceph: fix error handling in process_one_ticket()
libceph: validate blob_struct_v in process_one_ticket()
libceph: drop version variable from ceph_monmap_decode()
libceph: make ceph_msg_data_advance() return void
libceph: use kbasename() and kill ceph_file_part()

+34 -35
+5 -1
fs/ceph/file.c
··· 1671 1671 } 1672 1672 1673 1673 size = i_size_read(inode); 1674 - if (!(mode & FALLOC_FL_KEEP_SIZE)) 1674 + if (!(mode & FALLOC_FL_KEEP_SIZE)) { 1675 1675 endoff = offset + length; 1676 + ret = inode_newsize_ok(inode, endoff); 1677 + if (ret) 1678 + goto unlock; 1679 + } 1676 1680 1677 1681 if (fi->fmode & CEPH_FILE_MODE_LAZY) 1678 1682 want = CEPH_CAP_FILE_BUFFER | CEPH_CAP_FILE_LAZYIO;
+3 -3
include/linux/ceph/ceph_debug.h
··· 3 3 4 4 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 5 5 6 + #include <linux/string.h> 7 + 6 8 #ifdef CONFIG_CEPH_LIB_PRETTYDEBUG 7 9 8 10 /* ··· 14 12 */ 15 13 16 14 # if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG) 17 - extern const char *ceph_file_part(const char *s, int len); 18 15 # define dout(fmt, ...) \ 19 16 pr_debug("%.*s %12.12s:%-4d : " fmt, \ 20 17 8 - (int)sizeof(KBUILD_MODNAME), " ", \ 21 - ceph_file_part(__FILE__, sizeof(__FILE__)), \ 22 - __LINE__, ##__VA_ARGS__) 18 + kbasename(__FILE__), __LINE__, ##__VA_ARGS__) 23 19 # else 24 20 /* faux printk call just to see any compiler warnings. */ 25 21 # define dout(fmt, ...) do { \
+8 -5
net/ceph/auth_x.c
··· 151 151 struct timespec validity; 152 152 void *tp, *tpend; 153 153 void **ptp; 154 - struct ceph_crypto_key new_session_key; 154 + struct ceph_crypto_key new_session_key = { 0 }; 155 155 struct ceph_buffer *new_ticket_blob; 156 156 unsigned long new_expires, new_renew_after; 157 157 u64 new_secret_id; ··· 215 215 dout(" ticket blob is %d bytes\n", dlen); 216 216 ceph_decode_need(ptp, tpend, 1 + sizeof(u64), bad); 217 217 blob_struct_v = ceph_decode_8(ptp); 218 + if (blob_struct_v != 1) 219 + goto bad; 220 + 218 221 new_secret_id = ceph_decode_64(ptp); 219 222 ret = ceph_decode_buffer(&new_ticket_blob, ptp, tpend); 220 223 if (ret) ··· 237 234 type, ceph_entity_type_name(type), th->secret_id, 238 235 (int)th->ticket_blob->vec.iov_len); 239 236 xi->have_keys |= th->service; 240 - 241 - out: 242 - return ret; 237 + return 0; 243 238 244 239 bad: 245 240 ret = -EINVAL; 246 - goto out; 241 + out: 242 + ceph_crypto_key_destroy(&new_session_key); 243 + return ret; 247 244 } 248 245 249 246 static int ceph_x_proc_ticket_reply(struct ceph_auth_client *ac,
-13
net/ceph/ceph_common.c
··· 56 56 module_param_cb(supported_features, &param_ops_supported_features, NULL, 57 57 S_IRUGO); 58 58 59 - /* 60 - * find filename portion of a path (/foo/bar/baz -> baz) 61 - */ 62 - const char *ceph_file_part(const char *s, int len) 63 - { 64 - const char *e = s + len; 65 - 66 - while (e != s && *(e-1) != '/') 67 - e--; 68 - return e; 69 - } 70 - EXPORT_SYMBOL(ceph_file_part); 71 - 72 59 const char *ceph_msg_type_name(int type) 73 60 { 74 61 switch (type) {
+16 -10
net/ceph/messenger.c
··· 1174 1174 * Returns true if the result moves the cursor on to the next piece 1175 1175 * of the data item. 1176 1176 */ 1177 - static bool ceph_msg_data_advance(struct ceph_msg_data_cursor *cursor, 1178 - size_t bytes) 1177 + static void ceph_msg_data_advance(struct ceph_msg_data_cursor *cursor, 1178 + size_t bytes) 1179 1179 { 1180 1180 bool new_piece; 1181 1181 ··· 1207 1207 new_piece = true; 1208 1208 } 1209 1209 cursor->need_crc = new_piece; 1210 - 1211 - return new_piece; 1212 1210 } 1213 1211 1214 1212 static size_t sizeof_footer(struct ceph_connection *con) ··· 1575 1577 size_t page_offset; 1576 1578 size_t length; 1577 1579 bool last_piece; 1578 - bool need_crc; 1579 1580 int ret; 1580 1581 1581 1582 page = ceph_msg_data_next(cursor, &page_offset, &length, ··· 1589 1592 } 1590 1593 if (do_datacrc && cursor->need_crc) 1591 1594 crc = ceph_crc32c_page(crc, page, page_offset, length); 1592 - need_crc = ceph_msg_data_advance(cursor, (size_t)ret); 1595 + ceph_msg_data_advance(cursor, (size_t)ret); 1593 1596 } 1594 1597 1595 1598 dout("%s %p msg %p done\n", __func__, con, msg); ··· 2228 2231 struct ceph_msg *m; 2229 2232 u64 ack = le64_to_cpu(con->in_temp_ack); 2230 2233 u64 seq; 2234 + bool reconnect = (con->in_tag == CEPH_MSGR_TAG_SEQ); 2235 + struct list_head *list = reconnect ? &con->out_queue : &con->out_sent; 2231 2236 2232 - while (!list_empty(&con->out_sent)) { 2233 - m = list_first_entry(&con->out_sent, struct ceph_msg, 2234 - list_head); 2237 + /* 2238 + * In the reconnect case, con_fault() has requeued messages 2239 + * in out_sent. We should cleanup old messages according to 2240 + * the reconnect seq. 2241 + */ 2242 + while (!list_empty(list)) { 2243 + m = list_first_entry(list, struct ceph_msg, list_head); 2244 + if (reconnect && m->needs_out_seq) 2245 + break; 2235 2246 seq = le64_to_cpu(m->hdr.seq); 2236 2247 if (seq > ack) 2237 2248 break; ··· 2248 2243 m->ack_stamp = jiffies; 2249 2244 ceph_msg_remove(m); 2250 2245 } 2246 + 2251 2247 prepare_read_tag(con); 2252 2248 } 2253 2249 ··· 2305 2299 2306 2300 if (do_datacrc) 2307 2301 crc = ceph_crc32c_page(crc, page, page_offset, ret); 2308 - (void) ceph_msg_data_advance(cursor, (size_t)ret); 2302 + ceph_msg_data_advance(cursor, (size_t)ret); 2309 2303 } 2310 2304 if (do_datacrc) 2311 2305 con->in_data_crc = crc;
+1 -3
net/ceph/mon_client.c
··· 43 43 int i, err = -EINVAL; 44 44 struct ceph_fsid fsid; 45 45 u32 epoch, num_mon; 46 - u16 version; 47 46 u32 len; 48 47 49 48 ceph_decode_32_safe(&p, end, len, bad); 50 49 ceph_decode_need(&p, end, len, bad); 51 50 52 51 dout("monmap_decode %p %p len %d\n", p, end, (int)(end-p)); 53 - 54 - ceph_decode_16_safe(&p, end, version, bad); 52 + p += sizeof(u16); /* skip version */ 55 53 56 54 ceph_decode_need(&p, end, sizeof(fsid) + 2*sizeof(u32), bad); 57 55 ceph_decode_copy(&p, &fsid, sizeof(fsid));
+1
net/ceph/osdmap.c
··· 317 317 u32 yes; 318 318 struct crush_rule *r; 319 319 320 + err = -EINVAL; 320 321 ceph_decode_32_safe(p, end, yes, bad); 321 322 if (!yes) { 322 323 dout("crush_decode NO rule %d off %x %p to %p\n",