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

Pull ceph updates from Ilya Dryomov:
"A fix for a memory leak from Antoine (marked for stable) and two
cleanups from Liang and Slava"

* tag 'ceph-for-6.14-rc1' of https://github.com/ceph/ceph-client:
ceph: exchange hardcoded value on NAME_MAX
ceph: streamline request head structures in MDS client
ceph: fix memory leak in ceph_mds_auth_match()

+17 -31
+1 -1
fs/ceph/debugfs.c
··· 412 412 413 413 void ceph_fs_debugfs_init(struct ceph_fs_client *fsc) 414 414 { 415 - char name[100]; 415 + char name[NAME_MAX]; 416 416 417 417 doutc(fsc->client, "begin\n"); 418 418 fsc->debugfs_congestion_kb =
+16 -16
fs/ceph/mds_client.c
··· 2948 2948 find_legacy_request_head(void *p, u64 features) 2949 2949 { 2950 2950 bool legacy = !(features & CEPH_FEATURE_FS_BTIME); 2951 - struct ceph_mds_request_head_old *ohead; 2951 + struct ceph_mds_request_head *head; 2952 2952 2953 2953 if (legacy) 2954 2954 return (struct ceph_mds_request_head_legacy *)p; 2955 - ohead = (struct ceph_mds_request_head_old *)p; 2956 - return (struct ceph_mds_request_head_legacy *)&ohead->oldest_client_tid; 2955 + head = (struct ceph_mds_request_head *)p; 2956 + return (struct ceph_mds_request_head_legacy *)&head->oldest_client_tid; 2957 2957 } 2958 2958 2959 2959 /* ··· 3023 3023 if (legacy) 3024 3024 len = sizeof(struct ceph_mds_request_head_legacy); 3025 3025 else if (request_head_version == 1) 3026 - len = sizeof(struct ceph_mds_request_head_old); 3026 + len = offsetofend(struct ceph_mds_request_head, args); 3027 3027 else if (request_head_version == 2) 3028 3028 len = offsetofend(struct ceph_mds_request_head, ext_num_fwd); 3029 3029 else ··· 3107 3107 msg->hdr.version = cpu_to_le16(3); 3108 3108 p = msg->front.iov_base + sizeof(*lhead); 3109 3109 } else if (request_head_version == 1) { 3110 - struct ceph_mds_request_head_old *ohead = msg->front.iov_base; 3110 + struct ceph_mds_request_head *nhead = msg->front.iov_base; 3111 3111 3112 3112 msg->hdr.version = cpu_to_le16(4); 3113 - ohead->version = cpu_to_le16(1); 3114 - p = msg->front.iov_base + sizeof(*ohead); 3113 + nhead->version = cpu_to_le16(1); 3114 + p = msg->front.iov_base + offsetofend(struct ceph_mds_request_head, args); 3115 3115 } else if (request_head_version == 2) { 3116 3116 struct ceph_mds_request_head *nhead = msg->front.iov_base; 3117 3117 ··· 3268 3268 * so we limit to retry at most 256 times. 3269 3269 */ 3270 3270 if (req->r_attempts) { 3271 - old_max_retry = sizeof_field(struct ceph_mds_request_head_old, 3271 + old_max_retry = sizeof_field(struct ceph_mds_request_head, 3272 3272 num_retry); 3273 3273 old_max_retry = 1 << (old_max_retry * BITS_PER_BYTE); 3274 3274 if ((old_version && req->r_attempts >= old_max_retry) || ··· 5693 5693 * 5694 5694 * All the other cases --> mismatch 5695 5695 */ 5696 + bool path_matched = true; 5696 5697 char *first = strstr(_tpath, auth->match.path); 5697 - if (first != _tpath) { 5698 - if (free_tpath) 5699 - kfree(_tpath); 5700 - return 0; 5698 + if (first != _tpath || 5699 + (tlen > len && _tpath[len] != '/')) { 5700 + path_matched = false; 5701 5701 } 5702 5702 5703 - if (tlen > len && _tpath[len] != '/') { 5704 - if (free_tpath) 5705 - kfree(_tpath); 5703 + if (free_tpath) 5704 + kfree(_tpath); 5705 + 5706 + if (!path_matched) 5706 5707 return 0; 5707 - } 5708 5708 } 5709 5709 } 5710 5710
-14
include/linux/ceph/ceph_fs.h
··· 504 504 505 505 #define CEPH_MDS_REQUEST_HEAD_VERSION 3 506 506 507 - struct ceph_mds_request_head_old { 508 - __le16 version; /* struct version */ 509 - __le64 oldest_client_tid; 510 - __le32 mdsmap_epoch; /* on client */ 511 - __le32 flags; /* CEPH_MDS_FLAG_* */ 512 - __u8 num_retry, num_fwd; /* count retry, fwd attempts */ 513 - __le16 num_releases; /* # include cap/lease release records */ 514 - __le32 op; /* mds op code */ 515 - __le32 caller_uid, caller_gid; 516 - __le64 ino; /* use this ino for openc, mkdir, mknod, 517 - etc. (if replaying) */ 518 - union ceph_mds_request_args_ext args; 519 - } __attribute__ ((packed)); 520 - 521 507 struct ceph_mds_request_head { 522 508 __le16 version; /* struct version */ 523 509 __le64 oldest_client_tid;