@@ -2948,12 +2948,12 @@ static struct ceph_mds_request_head_legacy *
29482948find_legacy_request_head (void * p , u64 features )
29492949{
29502950 bool legacy = !(features & CEPH_FEATURE_FS_BTIME );
2951- struct ceph_mds_request_head_old * ohead ;
2951+ struct ceph_mds_request_head * head ;
29522952
29532953 if (legacy )
29542954 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 ;
29572957}
29582958
29592959/*
@@ -3023,7 +3023,7 @@ static struct ceph_msg *create_request_message(struct ceph_mds_session *session,
30233023 if (legacy )
30243024 len = sizeof (struct ceph_mds_request_head_legacy );
30253025 else if (request_head_version == 1 )
3026- len = sizeof (struct ceph_mds_request_head_old );
3026+ len = offsetofend (struct ceph_mds_request_head , args );
30273027 else if (request_head_version == 2 )
30283028 len = offsetofend (struct ceph_mds_request_head , ext_num_fwd );
30293029 else
@@ -3107,11 +3107,11 @@ static struct ceph_msg *create_request_message(struct ceph_mds_session *session,
31073107 msg -> hdr .version = cpu_to_le16 (3 );
31083108 p = msg -> front .iov_base + sizeof (* lhead );
31093109 } 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 ;
31113111
31123112 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 );
31153115 } else if (request_head_version == 2 ) {
31163116 struct ceph_mds_request_head * nhead = msg -> front .iov_base ;
31173117
@@ -3268,7 +3268,7 @@ static int __prepare_send_request(struct ceph_mds_session *session,
32683268 * so we limit to retry at most 256 times.
32693269 */
32703270 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 ,
32723272 num_retry );
32733273 old_max_retry = 1 << (old_max_retry * BITS_PER_BYTE );
32743274 if ((old_version && req -> r_attempts >= old_max_retry ) ||
@@ -5693,18 +5693,18 @@ static int ceph_mds_auth_match(struct ceph_mds_client *mdsc,
56935693 *
56945694 * All the other cases --> mismatch
56955695 */
5696+ bool path_matched = true;
56965697 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;
57015701 }
57025702
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 )
57065707 return 0 ;
5707- }
57085708 }
57095709 }
57105710
0 commit comments