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-6.19-rc1' of https://github.com/ceph/ceph-client

Pull ceph updates from Ilya Dryomov:
"We have a patch that adds an initial set of tracepoints to the MDS
client from Max, a fix that hardens osdmap parsing code from myself
(marked for stable) and a few assorted fixups"

* tag 'ceph-for-6.19-rc1' of https://github.com/ceph/ceph-client:
rbd: stop selecting CRC32, CRYPTO, and CRYPTO_AES
ceph: stop selecting CRC32, CRYPTO, and CRYPTO_AES
libceph: make decode_pool() more resilient against corrupted osdmaps
libceph: Amend checking to fix `make W=1` build breakage
ceph: Amend checking to fix `make W=1` build breakage
ceph: add trace points to the MDS client
libceph: fix log output race condition in OSD client

+316 -79
-3
drivers/block/Kconfig
··· 316 316 tristate "Rados block device (RBD)" 317 317 depends on INET && BLOCK 318 318 select CEPH_LIB 319 - select CRC32 320 - select CRYPTO_AES 321 - select CRYPTO 322 319 help 323 320 Say Y here if you want include the Rados block device, which stripes 324 321 a block device over objects stored in the Ceph distributed object
-3
fs/ceph/Kconfig
··· 3 3 tristate "Ceph distributed file system" 4 4 depends on INET 5 5 select CEPH_LIB 6 - select CRC32 7 - select CRYPTO_AES 8 - select CRYPTO 9 6 select NETFS_SUPPORT 10 7 select FS_ENCRYPTION_ALGS if FS_ENCRYPTION 11 8 default n
+4
fs/ceph/caps.c
··· 18 18 #include "crypto.h" 19 19 #include <linux/ceph/decode.h> 20 20 #include <linux/ceph/messenger.h> 21 + #include <trace/events/ceph.h> 21 22 22 23 /* 23 24 * Capability management ··· 4452 4451 doutc(cl, " caps mds%d op %s ino %llx.%llx inode %p seq %u iseq %u mseq %u\n", 4453 4452 session->s_mds, ceph_cap_op_name(op), vino.ino, vino.snap, inode, 4454 4453 seq, issue_seq, mseq); 4454 + 4455 + trace_ceph_handle_caps(mdsc, session, op, &vino, ceph_inode(inode), 4456 + seq, issue_seq, mseq); 4455 4457 4456 4458 mutex_lock(&session->s_mutex); 4457 4459
+18 -2
fs/ceph/mds_client.c
··· 24 24 #include <linux/ceph/pagelist.h> 25 25 #include <linux/ceph/auth.h> 26 26 #include <linux/ceph/debugfs.h> 27 + #include <trace/events/ceph.h> 27 28 28 29 #define RECONNECT_MAX_SIZE (INT_MAX - PAGE_SIZE) 29 30 ··· 3289 3288 { 3290 3289 req->r_end_latency = ktime_get(); 3291 3290 3291 + trace_ceph_mdsc_complete_request(mdsc, req); 3292 + 3292 3293 if (req->r_callback) 3293 3294 req->r_callback(mdsc, req); 3294 3295 complete_all(&req->r_completion); ··· 3422 3419 { 3423 3420 int err; 3424 3421 3422 + trace_ceph_mdsc_send_request(session, req); 3423 + 3425 3424 err = __prepare_send_request(session, req, drop_cap_releases); 3426 3425 if (!err) { 3427 3426 ceph_msg_get(req->r_request); ··· 3475 3470 } 3476 3471 if (mdsc->mdsmap->m_epoch == 0) { 3477 3472 doutc(cl, "no mdsmap, waiting for map\n"); 3473 + trace_ceph_mdsc_suspend_request(mdsc, session, req, 3474 + ceph_mdsc_suspend_reason_no_mdsmap); 3478 3475 list_add(&req->r_wait, &mdsc->waiting_for_map); 3479 3476 return; 3480 3477 } ··· 3498 3491 goto finish; 3499 3492 } 3500 3493 doutc(cl, "no mds or not active, waiting for map\n"); 3494 + trace_ceph_mdsc_suspend_request(mdsc, session, req, 3495 + ceph_mdsc_suspend_reason_no_active_mds); 3501 3496 list_add(&req->r_wait, &mdsc->waiting_for_map); 3502 3497 return; 3503 3498 } ··· 3545 3536 * it to the mdsc queue. 3546 3537 */ 3547 3538 if (session->s_state == CEPH_MDS_SESSION_REJECTED) { 3548 - if (ceph_test_mount_opt(mdsc->fsc, CLEANRECOVER)) 3539 + if (ceph_test_mount_opt(mdsc->fsc, CLEANRECOVER)) { 3540 + trace_ceph_mdsc_suspend_request(mdsc, session, req, 3541 + ceph_mdsc_suspend_reason_rejected); 3549 3542 list_add(&req->r_wait, &mdsc->waiting_for_map); 3550 - else 3543 + } else 3551 3544 err = -EACCES; 3552 3545 goto out_session; 3553 3546 } ··· 3563 3552 if (random) 3564 3553 req->r_resend_mds = mds; 3565 3554 } 3555 + trace_ceph_mdsc_suspend_request(mdsc, session, req, 3556 + ceph_mdsc_suspend_reason_session); 3566 3557 list_add(&req->r_wait, &session->s_waiting); 3567 3558 goto out_session; 3568 3559 } ··· 3665 3652 list_del_init(&req->r_wait); 3666 3653 doutc(cl, " wake request %p tid %llu\n", req, 3667 3654 req->r_tid); 3655 + trace_ceph_mdsc_resume_request(mdsc, req); 3668 3656 __do_request(mdsc, req); 3669 3657 } 3670 3658 } ··· 3692 3678 req->r_session->s_mds == mds) { 3693 3679 doutc(cl, " kicking tid %llu\n", req->r_tid); 3694 3680 list_del_init(&req->r_wait); 3681 + trace_ceph_mdsc_resume_request(mdsc, req); 3695 3682 __do_request(mdsc, req); 3696 3683 } 3697 3684 } ··· 3739 3724 doutc(cl, "submit_request on %p for inode %p\n", req, dir); 3740 3725 mutex_lock(&mdsc->mutex); 3741 3726 __register_request(mdsc, req, dir); 3727 + trace_ceph_mdsc_submit_request(mdsc, req); 3742 3728 __do_request(mdsc, req); 3743 3729 err = req->r_err; 3744 3730 mutex_unlock(&mdsc->mutex);
+1 -1
fs/ceph/snap.c
··· 374 374 375 375 /* alloc new snap context */ 376 376 err = -ENOMEM; 377 - if (num > (SIZE_MAX - sizeof(*snapc)) / sizeof(u64)) 377 + if ((size_t)num > (SIZE_MAX - sizeof(*snapc)) / sizeof(u64)) 378 378 goto fail; 379 379 snapc = ceph_create_snap_context(num, GFP_NOFS); 380 380 if (!snapc)
+3
fs/ceph/super.c
··· 30 30 31 31 #include <uapi/linux/magic.h> 32 32 33 + #define CREATE_TRACE_POINTS 34 + #include <trace/events/ceph.h> 35 + 33 36 static DEFINE_SPINLOCK(ceph_fsc_lock); 34 37 static LIST_HEAD(ceph_fsc_list); 35 38
+234
include/trace/events/ceph.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 + /* Ceph filesystem support module tracepoints 3 + * 4 + * Copyright (C) 2025 IONOS SE. All Rights Reserved. 5 + * Written by Max Kellermann (max.kellermann@ionos.com) 6 + */ 7 + #undef TRACE_SYSTEM 8 + #define TRACE_SYSTEM ceph 9 + 10 + #if !defined(_TRACE_CEPH_H) || defined(TRACE_HEADER_MULTI_READ) 11 + #define _TRACE_CEPH_H 12 + 13 + #include <linux/tracepoint.h> 14 + 15 + #define ceph_mdsc_suspend_reasons \ 16 + EM(ceph_mdsc_suspend_reason_no_mdsmap, "no-mdsmap") \ 17 + EM(ceph_mdsc_suspend_reason_no_active_mds, "no-active-mds") \ 18 + EM(ceph_mdsc_suspend_reason_rejected, "rejected") \ 19 + E_(ceph_mdsc_suspend_reason_session, "session") 20 + 21 + #ifndef __NETFS_DECLARE_TRACE_ENUMS_ONCE_ONLY 22 + #define __NETFS_DECLARE_TRACE_ENUMS_ONCE_ONLY 23 + 24 + #undef EM 25 + #undef E_ 26 + #define EM(a, b) a, 27 + #define E_(a, b) a 28 + 29 + enum ceph_mdsc_suspend_reason { ceph_mdsc_suspend_reasons } __mode(byte); 30 + 31 + #endif 32 + 33 + /* 34 + * Export enum symbols via userspace. 35 + */ 36 + #undef EM 37 + #undef E_ 38 + #define EM(a, b) TRACE_DEFINE_ENUM(a); 39 + #define E_(a, b) TRACE_DEFINE_ENUM(a); 40 + 41 + ceph_mdsc_suspend_reasons; 42 + 43 + /* 44 + * Now redefine the EM() and E_() macros to map the enums to the strings that 45 + * will be printed in the output. 46 + */ 47 + #undef EM 48 + #undef E_ 49 + #define EM(a, b) { a, b }, 50 + #define E_(a, b) { a, b } 51 + 52 + TRACE_EVENT(ceph_mdsc_submit_request, 53 + TP_PROTO(struct ceph_mds_client *mdsc, 54 + struct ceph_mds_request *req), 55 + 56 + TP_ARGS(mdsc, req), 57 + 58 + TP_STRUCT__entry( 59 + __field(u64, tid) 60 + __field(int, op) 61 + __field(u64, ino) 62 + __field(u64, snap) 63 + ), 64 + 65 + TP_fast_assign( 66 + struct inode *inode; 67 + 68 + __entry->tid = req->r_tid; 69 + __entry->op = req->r_op; 70 + 71 + inode = req->r_inode; 72 + if (inode == NULL && req->r_dentry) 73 + inode = d_inode(req->r_dentry); 74 + 75 + if (inode) { 76 + __entry->ino = ceph_ino(inode); 77 + __entry->snap = ceph_snap(inode); 78 + } else { 79 + __entry->ino = __entry->snap = 0; 80 + } 81 + ), 82 + 83 + TP_printk("R=%llu op=%s ino=%llx,%llx", 84 + __entry->tid, 85 + ceph_mds_op_name(__entry->op), 86 + __entry->ino, __entry->snap) 87 + ); 88 + 89 + TRACE_EVENT(ceph_mdsc_suspend_request, 90 + TP_PROTO(struct ceph_mds_client *mdsc, 91 + struct ceph_mds_session *session, 92 + struct ceph_mds_request *req, 93 + enum ceph_mdsc_suspend_reason reason), 94 + 95 + TP_ARGS(mdsc, session, req, reason), 96 + 97 + TP_STRUCT__entry( 98 + __field(u64, tid) 99 + __field(int, op) 100 + __field(int, mds) 101 + __field(enum ceph_mdsc_suspend_reason, reason) 102 + ), 103 + 104 + TP_fast_assign( 105 + __entry->tid = req->r_tid; 106 + __entry->op = req->r_op; 107 + __entry->mds = session ? session->s_mds : -1; 108 + __entry->reason = reason; 109 + ), 110 + 111 + TP_printk("R=%llu op=%s reason=%s", 112 + __entry->tid, 113 + ceph_mds_op_name(__entry->op), 114 + __print_symbolic(__entry->reason, ceph_mdsc_suspend_reasons)) 115 + ); 116 + 117 + TRACE_EVENT(ceph_mdsc_resume_request, 118 + TP_PROTO(struct ceph_mds_client *mdsc, 119 + struct ceph_mds_request *req), 120 + 121 + TP_ARGS(mdsc, req), 122 + 123 + TP_STRUCT__entry( 124 + __field(u64, tid) 125 + __field(int, op) 126 + ), 127 + 128 + TP_fast_assign( 129 + __entry->tid = req->r_tid; 130 + __entry->op = req->r_op; 131 + ), 132 + 133 + TP_printk("R=%llu op=%s", 134 + __entry->tid, 135 + ceph_mds_op_name(__entry->op)) 136 + ); 137 + 138 + TRACE_EVENT(ceph_mdsc_send_request, 139 + TP_PROTO(struct ceph_mds_session *session, 140 + struct ceph_mds_request *req), 141 + 142 + TP_ARGS(session, req), 143 + 144 + TP_STRUCT__entry( 145 + __field(u64, tid) 146 + __field(int, op) 147 + __field(int, mds) 148 + ), 149 + 150 + TP_fast_assign( 151 + __entry->tid = req->r_tid; 152 + __entry->op = req->r_op; 153 + __entry->mds = session->s_mds; 154 + ), 155 + 156 + TP_printk("R=%llu op=%s mds=%d", 157 + __entry->tid, 158 + ceph_mds_op_name(__entry->op), 159 + __entry->mds) 160 + ); 161 + 162 + TRACE_EVENT(ceph_mdsc_complete_request, 163 + TP_PROTO(struct ceph_mds_client *mdsc, 164 + struct ceph_mds_request *req), 165 + 166 + TP_ARGS(mdsc, req), 167 + 168 + TP_STRUCT__entry( 169 + __field(u64, tid) 170 + __field(int, op) 171 + __field(int, err) 172 + __field(unsigned long, latency_ns) 173 + ), 174 + 175 + TP_fast_assign( 176 + __entry->tid = req->r_tid; 177 + __entry->op = req->r_op; 178 + __entry->err = req->r_err; 179 + __entry->latency_ns = req->r_end_latency - req->r_start_latency; 180 + ), 181 + 182 + TP_printk("R=%llu op=%s err=%d latency_ns=%lu", 183 + __entry->tid, 184 + ceph_mds_op_name(__entry->op), 185 + __entry->err, 186 + __entry->latency_ns) 187 + ); 188 + 189 + TRACE_EVENT(ceph_handle_caps, 190 + TP_PROTO(struct ceph_mds_client *mdsc, 191 + struct ceph_mds_session *session, 192 + int op, 193 + const struct ceph_vino *vino, 194 + struct ceph_inode_info *inode, 195 + u32 seq, u32 mseq, u32 issue_seq), 196 + 197 + TP_ARGS(mdsc, session, op, vino, inode, seq, mseq, issue_seq), 198 + 199 + TP_STRUCT__entry( 200 + __field(int, mds) 201 + __field(int, op) 202 + __field(u64, ino) 203 + __field(u64, snap) 204 + __field(u32, seq) 205 + __field(u32, mseq) 206 + __field(u32, issue_seq) 207 + ), 208 + 209 + TP_fast_assign( 210 + __entry->mds = session->s_mds; 211 + __entry->op = op; 212 + __entry->ino = vino->ino; 213 + __entry->snap = vino->snap; 214 + __entry->seq = seq; 215 + __entry->mseq = mseq; 216 + __entry->issue_seq = issue_seq; 217 + ), 218 + 219 + TP_printk("mds=%d op=%s vino=%llx.%llx seq=%u iseq=%u mseq=%u", 220 + __entry->mds, 221 + ceph_cap_op_name(__entry->op), 222 + __entry->ino, 223 + __entry->snap, 224 + __entry->seq, 225 + __entry->issue_seq, 226 + __entry->mseq) 227 + ); 228 + 229 + #undef EM 230 + #undef E_ 231 + #endif /* _TRACE_CEPH_H */ 232 + 233 + /* This part must be outside protection */ 234 + #include <trace/define_trace.h>
+2 -4
net/ceph/osd_client.c
··· 1280 1280 static struct ceph_osd *get_osd(struct ceph_osd *osd) 1281 1281 { 1282 1282 if (refcount_inc_not_zero(&osd->o_ref)) { 1283 - dout("get_osd %p %d -> %d\n", osd, refcount_read(&osd->o_ref)-1, 1284 - refcount_read(&osd->o_ref)); 1283 + dout("get_osd %p -> %d\n", osd, refcount_read(&osd->o_ref)); 1285 1284 return osd; 1286 1285 } else { 1287 1286 dout("get_osd %p FAIL\n", osd); ··· 1290 1291 1291 1292 static void put_osd(struct ceph_osd *osd) 1292 1293 { 1293 - dout("put_osd %p %d -> %d\n", osd, refcount_read(&osd->o_ref), 1294 - refcount_read(&osd->o_ref) - 1); 1294 + dout("put_osd %p -> %d\n", osd, refcount_read(&osd->o_ref) - 1); 1295 1295 if (refcount_dec_and_test(&osd->o_ref)) { 1296 1296 osd_cleanup(osd); 1297 1297 kfree(osd);
+54 -66
net/ceph/osdmap.c
··· 806 806 ceph_decode_need(p, end, len, bad); 807 807 pool_end = *p + len; 808 808 809 + ceph_decode_need(p, end, 4 + 4 + 4, bad); 809 810 pi->type = ceph_decode_8(p); 810 811 pi->size = ceph_decode_8(p); 811 812 pi->crush_ruleset = ceph_decode_8(p); 812 813 pi->object_hash = ceph_decode_8(p); 813 - 814 814 pi->pg_num = ceph_decode_32(p); 815 815 pi->pgp_num = ceph_decode_32(p); 816 816 817 - *p += 4 + 4; /* skip lpg* */ 818 - *p += 4; /* skip last_change */ 819 - *p += 8 + 4; /* skip snap_seq, snap_epoch */ 817 + /* lpg*, last_change, snap_seq, snap_epoch */ 818 + ceph_decode_skip_n(p, end, 8 + 4 + 8 + 4, bad); 820 819 821 820 /* skip snaps */ 822 - num = ceph_decode_32(p); 821 + ceph_decode_32_safe(p, end, num, bad); 823 822 while (num--) { 824 - *p += 8; /* snapid key */ 825 - *p += 1 + 1; /* versions */ 826 - len = ceph_decode_32(p); 827 - *p += len; 823 + /* snapid key, pool snap (with versions) */ 824 + ceph_decode_skip_n(p, end, 8 + 2, bad); 825 + ceph_decode_skip_string(p, end, bad); 828 826 } 829 827 830 - /* skip removed_snaps */ 831 - num = ceph_decode_32(p); 832 - *p += num * (8 + 8); 828 + /* removed_snaps */ 829 + ceph_decode_skip_map(p, end, 64, 64, bad); 833 830 831 + ceph_decode_need(p, end, 8 + 8 + 4, bad); 834 832 *p += 8; /* skip auid */ 835 833 pi->flags = ceph_decode_64(p); 836 834 *p += 4; /* skip crash_replay_interval */ 837 835 838 836 if (ev >= 7) 839 - pi->min_size = ceph_decode_8(p); 837 + ceph_decode_8_safe(p, end, pi->min_size, bad); 840 838 else 841 839 pi->min_size = pi->size - pi->size / 2; 842 840 843 841 if (ev >= 8) 844 - *p += 8 + 8; /* skip quota_max_* */ 842 + /* quota_max_* */ 843 + ceph_decode_skip_n(p, end, 8 + 8, bad); 845 844 846 845 if (ev >= 9) { 847 - /* skip tiers */ 848 - num = ceph_decode_32(p); 849 - *p += num * 8; 846 + /* tiers */ 847 + ceph_decode_skip_set(p, end, 64, bad); 850 848 849 + ceph_decode_need(p, end, 8 + 1 + 8 + 8, bad); 851 850 *p += 8; /* skip tier_of */ 852 851 *p += 1; /* skip cache_mode */ 853 - 854 852 pi->read_tier = ceph_decode_64(p); 855 853 pi->write_tier = ceph_decode_64(p); 856 854 } else { ··· 856 858 pi->write_tier = -1; 857 859 } 858 860 859 - if (ev >= 10) { 860 - /* skip properties */ 861 - num = ceph_decode_32(p); 862 - while (num--) { 863 - len = ceph_decode_32(p); 864 - *p += len; /* key */ 865 - len = ceph_decode_32(p); 866 - *p += len; /* val */ 867 - } 868 - } 861 + if (ev >= 10) 862 + /* properties */ 863 + ceph_decode_skip_map(p, end, string, string, bad); 869 864 870 865 if (ev >= 11) { 871 - /* skip hit_set_params */ 872 - *p += 1 + 1; /* versions */ 873 - len = ceph_decode_32(p); 874 - *p += len; 866 + /* hit_set_params (with versions) */ 867 + ceph_decode_skip_n(p, end, 2, bad); 868 + ceph_decode_skip_string(p, end, bad); 875 869 876 - *p += 4; /* skip hit_set_period */ 877 - *p += 4; /* skip hit_set_count */ 870 + /* hit_set_period, hit_set_count */ 871 + ceph_decode_skip_n(p, end, 4 + 4, bad); 878 872 } 879 873 880 874 if (ev >= 12) 881 - *p += 4; /* skip stripe_width */ 875 + /* stripe_width */ 876 + ceph_decode_skip_32(p, end, bad); 882 877 883 - if (ev >= 13) { 884 - *p += 8; /* skip target_max_bytes */ 885 - *p += 8; /* skip target_max_objects */ 886 - *p += 4; /* skip cache_target_dirty_ratio_micro */ 887 - *p += 4; /* skip cache_target_full_ratio_micro */ 888 - *p += 4; /* skip cache_min_flush_age */ 889 - *p += 4; /* skip cache_min_evict_age */ 890 - } 878 + if (ev >= 13) 879 + /* target_max_*, cache_target_*, cache_min_* */ 880 + ceph_decode_skip_n(p, end, 16 + 8 + 8, bad); 891 881 892 - if (ev >= 14) { 893 - /* skip erasure_code_profile */ 894 - len = ceph_decode_32(p); 895 - *p += len; 896 - } 882 + if (ev >= 14) 883 + /* erasure_code_profile */ 884 + ceph_decode_skip_string(p, end, bad); 897 885 898 886 /* 899 887 * last_force_op_resend_preluminous, will be overridden if the 900 888 * map was encoded with RESEND_ON_SPLIT 901 889 */ 902 890 if (ev >= 15) 903 - pi->last_force_request_resend = ceph_decode_32(p); 891 + ceph_decode_32_safe(p, end, pi->last_force_request_resend, bad); 904 892 else 905 893 pi->last_force_request_resend = 0; 906 894 907 895 if (ev >= 16) 908 - *p += 4; /* skip min_read_recency_for_promote */ 896 + /* min_read_recency_for_promote */ 897 + ceph_decode_skip_32(p, end, bad); 909 898 910 899 if (ev >= 17) 911 - *p += 8; /* skip expected_num_objects */ 900 + /* expected_num_objects */ 901 + ceph_decode_skip_64(p, end, bad); 912 902 913 903 if (ev >= 19) 914 - *p += 4; /* skip cache_target_dirty_high_ratio_micro */ 904 + /* cache_target_dirty_high_ratio_micro */ 905 + ceph_decode_skip_32(p, end, bad); 915 906 916 907 if (ev >= 20) 917 - *p += 4; /* skip min_write_recency_for_promote */ 908 + /* min_write_recency_for_promote */ 909 + ceph_decode_skip_32(p, end, bad); 918 910 919 911 if (ev >= 21) 920 - *p += 1; /* skip use_gmt_hitset */ 912 + /* use_gmt_hitset */ 913 + ceph_decode_skip_8(p, end, bad); 921 914 922 915 if (ev >= 22) 923 - *p += 1; /* skip fast_read */ 916 + /* fast_read */ 917 + ceph_decode_skip_8(p, end, bad); 924 918 925 - if (ev >= 23) { 926 - *p += 4; /* skip hit_set_grade_decay_rate */ 927 - *p += 4; /* skip hit_set_search_last_n */ 928 - } 919 + if (ev >= 23) 920 + /* hit_set_grade_decay_rate, hit_set_search_last_n */ 921 + ceph_decode_skip_n(p, end, 4 + 4, bad); 929 922 930 923 if (ev >= 24) { 931 - /* skip opts */ 932 - *p += 1 + 1; /* versions */ 933 - len = ceph_decode_32(p); 934 - *p += len; 924 + /* opts (with versions) */ 925 + ceph_decode_skip_n(p, end, 2, bad); 926 + ceph_decode_skip_string(p, end, bad); 935 927 } 936 928 937 929 if (ev >= 25) 938 - pi->last_force_request_resend = ceph_decode_32(p); 930 + ceph_decode_32_safe(p, end, pi->last_force_request_resend, bad); 939 931 940 932 /* ignore the rest */ 941 933 ··· 1426 1438 ceph_decode_32_safe(p, end, len, e_inval); 1427 1439 if (len == 0 && incremental) 1428 1440 return NULL; /* new_pg_temp: [] to remove */ 1429 - if (len > (SIZE_MAX - sizeof(*pg)) / sizeof(u32)) 1441 + if ((size_t)len > (SIZE_MAX - sizeof(*pg)) / sizeof(u32)) 1430 1442 return ERR_PTR(-EINVAL); 1431 1443 1432 1444 ceph_decode_need(p, end, len * sizeof(u32), e_inval); ··· 1607 1619 u32 len, i; 1608 1620 1609 1621 ceph_decode_32_safe(p, end, len, e_inval); 1610 - if (len > (SIZE_MAX - sizeof(*pg)) / (2 * sizeof(u32))) 1622 + if ((size_t)len > (SIZE_MAX - sizeof(*pg)) / (2 * sizeof(u32))) 1611 1623 return ERR_PTR(-EINVAL); 1612 1624 1613 1625 ceph_decode_need(p, end, 2 * len * sizeof(u32), e_inval);