From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B33DC433C1 for ; Wed, 24 Mar 2021 04:56:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0AA1C619EA for ; Wed, 24 Mar 2021 04:56:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232769AbhCXEzV (ORCPT ); Wed, 24 Mar 2021 00:55:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:34819 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232693AbhCXEyr (ORCPT ); Wed, 24 Mar 2021 00:54:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616561686; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0N617PbnRNzEzqXg6v1e+pmELWky6SIdDK6sK5M+q8U=; b=ffPmoHGefRSdJx8DtBfBjN9ghrch7eHHqRNt8rI8bcLeQ6U5iBBio47CTTFW0qF1EpNhZe iWt85+d9GeSivf+gzheDiL/n1wpo1KO+G3xeN8z3krHSIu9vZwD1jWOkezOiiZ4BeiVn8H prqKNqeSmYQLG0+PbhHbPtU9GlcybOM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-417-CCu_XvtONNWQkP0jLbsfvQ-1; Wed, 24 Mar 2021 00:54:42 -0400 X-MC-Unique: CCu_XvtONNWQkP0jLbsfvQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 058E21005D57; Wed, 24 Mar 2021 04:54:41 +0000 (UTC) Received: from [10.72.12.53] (ovpn-12-53.pek2.redhat.com [10.72.12.53]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E61B89CA0; Wed, 24 Mar 2021 04:54:38 +0000 (UTC) Subject: Re: [PATCH] ceph: send opened files/pinned caps/opened inodes metrics to MDS daemon To: Jeff Layton Cc: pdonnell@redhat.com, ceph-devel@vger.kernel.org, Ilya Dryomov References: <20201126034743.1151342-1-xiubli@redhat.com> <5c1461d4f7c03f226ed2458f491885cfe9b44841.camel@kernel.org> From: Xiubo Li Message-ID: <5f3ce92d-8c1c-d8de-1a10-bf30dc2800af@redhat.com> Date: Wed, 24 Mar 2021 12:54:36 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <5c1461d4f7c03f226ed2458f491885cfe9b44841.camel@kernel.org> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org 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