Commit 626d1a1e authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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()
parents 69b8923f 3981be13
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -412,7 +412,7 @@ void ceph_fs_debugfs_cleanup(struct ceph_fs_client *fsc)

void ceph_fs_debugfs_init(struct ceph_fs_client *fsc)
{
	char name[100];
	char name[NAME_MAX];

	doutc(fsc->client, "begin\n");
	fsc->debugfs_congestion_kb =
+16 −16
Original line number Diff line number Diff line
@@ -2948,12 +2948,12 @@ static struct ceph_mds_request_head_legacy *
find_legacy_request_head(void *p, u64 features)
{
	bool legacy = !(features & CEPH_FEATURE_FS_BTIME);
	struct ceph_mds_request_head_old *ohead;
	struct ceph_mds_request_head *head;

	if (legacy)
		return (struct ceph_mds_request_head_legacy *)p;
	ohead = (struct ceph_mds_request_head_old *)p;
	return (struct ceph_mds_request_head_legacy *)&ohead->oldest_client_tid;
	head = (struct ceph_mds_request_head *)p;
	return (struct ceph_mds_request_head_legacy *)&head->oldest_client_tid;
}

/*
@@ -3023,7 +3023,7 @@ static struct ceph_msg *create_request_message(struct ceph_mds_session *session,
	if (legacy)
		len = sizeof(struct ceph_mds_request_head_legacy);
	else if (request_head_version == 1)
		len = sizeof(struct ceph_mds_request_head_old);
		len = offsetofend(struct ceph_mds_request_head, args);
	else if (request_head_version == 2)
		len = offsetofend(struct ceph_mds_request_head, ext_num_fwd);
	else
@@ -3107,11 +3107,11 @@ static struct ceph_msg *create_request_message(struct ceph_mds_session *session,
		msg->hdr.version = cpu_to_le16(3);
		p = msg->front.iov_base + sizeof(*lhead);
	} else if (request_head_version == 1) {
		struct ceph_mds_request_head_old *ohead = msg->front.iov_base;
		struct ceph_mds_request_head *nhead = msg->front.iov_base;

		msg->hdr.version = cpu_to_le16(4);
		ohead->version = cpu_to_le16(1);
		p = msg->front.iov_base + sizeof(*ohead);
		nhead->version = cpu_to_le16(1);
		p = msg->front.iov_base + offsetofend(struct ceph_mds_request_head, args);
	} else if (request_head_version == 2) {
		struct ceph_mds_request_head *nhead = msg->front.iov_base;

@@ -3268,7 +3268,7 @@ static int __prepare_send_request(struct ceph_mds_session *session,
	 * so we limit to retry at most 256 times.
	 */
	if (req->r_attempts) {
	       old_max_retry = sizeof_field(struct ceph_mds_request_head_old,
	       old_max_retry = sizeof_field(struct ceph_mds_request_head,
					    num_retry);
	       old_max_retry = 1 << (old_max_retry * BITS_PER_BYTE);
	       if ((old_version && req->r_attempts >= old_max_retry) ||
@@ -5693,20 +5693,20 @@ static int ceph_mds_auth_match(struct ceph_mds_client *mdsc,
			 *
			 * All the other cases                       --> mismatch
			 */
			bool path_matched = true;
			char *first = strstr(_tpath, auth->match.path);
			if (first != _tpath) {
				if (free_tpath)
					kfree(_tpath);
				return 0;
			if (first != _tpath ||
			    (tlen > len && _tpath[len] != '/')) {
				path_matched = false;
			}

			if (tlen > len && _tpath[len] != '/') {
			if (free_tpath)
				kfree(_tpath);

			if (!path_matched)
				return 0;
		}
	}
	}

	doutc(cl, "matched\n");
	return 1;
+0 −14
Original line number Diff line number Diff line
@@ -504,20 +504,6 @@ struct ceph_mds_request_head_legacy {

#define CEPH_MDS_REQUEST_HEAD_VERSION  3

struct ceph_mds_request_head_old {
	__le16 version;                /* struct version */
	__le64 oldest_client_tid;
	__le32 mdsmap_epoch;           /* on client */
	__le32 flags;                  /* CEPH_MDS_FLAG_* */
	__u8 num_retry, num_fwd;       /* count retry, fwd attempts */
	__le16 num_releases;           /* # include cap/lease release records */
	__le32 op;                     /* mds op code */
	__le32 caller_uid, caller_gid;
	__le64 ino;                    /* use this ino for openc, mkdir, mknod,
					  etc. (if replaying) */
	union ceph_mds_request_args_ext args;
} __attribute__ ((packed));

struct ceph_mds_request_head {
	__le16 version;                /* struct version */
	__le64 oldest_client_tid;