On 2021/3/24 12:53, Xiubo Li wrote:
[...]
> diff --git a/fs/ceph/metric.c b/fs/ceph/metric.c
> index 5ec94bd4c1de..306bd599d940 100644
> --- a/fs/ceph/metric.c
> +++ b/fs/ceph/metric.c
> @@ -17,6 +17,9 @@ static bool ceph_mdsc_send_metrics(struct
ceph_mds_client *mdsc,
> struct ceph_metric_write_latency *write;
> struct ceph_metric_metadata_latency *meta;
> struct ceph_metric_dlease *dlease;
> + struct ceph_opened_files *files;
> + struct ceph_pinned_icaps *icaps;
> + struct ceph_opened_inodes *inodes;
> struct ceph_client_metric *m = &mdsc->metric;
> u64 nr_caps = atomic64_read(&m->total_caps);
> struct ceph_msg *msg;
> @@ -26,7 +29,8 @@ static bool ceph_mdsc_send_metrics(struct
ceph_mds_client *mdsc,
> s32 len;
>
> len = sizeof(*head) + sizeof(*cap) + sizeof(*read) +
sizeof(*write)
> - + sizeof(*meta) + sizeof(*dlease);
> + + sizeof(*meta) + sizeof(*dlease) + sizeof(files) +
sizeof(icaps)
> + + sizeof(inodes);
>
These sizeof values look wrong. The buffer requires more than pointers
for those. You probably want:
... + sizeof(*files) + sizeof(*icaps) + sizeof(*inodes);
Yeah, will fix it.
Thanks