Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3235573pxj; Tue, 1 Jun 2021 00:14:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxsy22f52iVlcyf9vzqfL+RagfXICkj+fdxP32Ce9sQBtzbIKp467CbDdjYdaRD5/6XBSn X-Received: by 2002:a92:911:: with SMTP id y17mr1309995ilg.101.1622531683958; Tue, 01 Jun 2021 00:14:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622531683; cv=none; d=google.com; s=arc-20160816; b=S3dP9R+9/CcIoSG2rOQBDfLeaVG29UGqSuyjyN/rk8NGlj6YLGh3MHaURfs13NeUZe lSZcjLANpYjvu9PZPz6h/C/mK8Hw9ujC6mLKbCsluIt8a0xXiSzeQcB2x3cJcMDDndrH jLAIrAubnzPLdM3aWVG3szY3Vgmkx5p5QQeRTref63V8NaCevz3i4fztxXyzaKrLjmYQ C2gck2GLonpxn75S2RVP2eGfVIzssVnUUFMM3KrC+ZrIdDOg6dXq4m0AkOc+qCoUAQ5B EzrwKbV7qYj6QBPGlA6lf8FHh7TmxCbe2fwM4UG2e2WizxgpBEjuYyjpllJm4LhNXPhi OAgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=PiPkw9a6EzlVijMSf7bT5urEU5FumVjAqJLtyTtqREU=; b=0zEDcfkI53bl3Nhh0fmwZZUd/3NkelWMN62USzA6yK01jGXSvo6VAmm6V8F4/HqieE fLptdm59uwLfWbIkbZb9++y26jtGFl1IJ0PWYJpSewcpwj9XM/brfyAgeXrX0mAKZ/6m havu/vcauHECFt3uAzgC81xHwT0hWtTHRuqU9jKdnWtm3LPYhUpWPLYhW5kAoC91h9rj LP8cMATGnsZEYh4VaHIonor0C0xF5rugvn6STatN66O14vjeZtuDwL8WnlS3abynaedf xDPy7cgS3YrN/z2OQyTXnOXsO/d02rXJeIasXQeBEdlM0R6aV7uC7orgWLDMKDEnHBx/ LuDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jA2lpEdA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r9si17536820iol.40.2021.06.01.00.14.23; Tue, 01 Jun 2021 00:14:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jA2lpEdA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233030AbhFAHPT (ORCPT + 99 others); Tue, 1 Jun 2021 03:15:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:39996 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229984AbhFAHPN (ORCPT ); Tue, 1 Jun 2021 03:15:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0D254610A8; Tue, 1 Jun 2021 07:13:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622531610; bh=dkkqEZ46ygeb8R6c460uRo7VIXi3q12IgWL/Sj2VTsw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jA2lpEdAC+eZixkGMXlCI7EmbgwV0TP5dmW1+yNGHrOM/shogRyaTLKBztC5OCyQz Vo0gtCVB5S0n5sOy9ioc2PCl8ZYCgyUVuYSkdtNEPbyvebR0ZO4epjYyQNabBmQZL8 OUSVqJCqi/4X2sMe4CmaWtJecQGlXiLhPviO/Y6s= Date: Tue, 1 Jun 2021 09:13:27 +0200 From: Greg KH To: "Song Bao Hua (Barry Song)" Cc: "tiantao (H)" , "linux-kernel@vger.kernel.org" , "akpm@linux-foundation.org" , Andy Shevchenko , "Rafael J. Wysocki" Subject: Re: [PATCH 1/2] topology: use bin_attribute to avoid buff overflow Message-ID: References: <1622516210-10886-1-git-send-email-tiantao6@hisilicon.com> <1622516210-10886-2-git-send-email-tiantao6@hisilicon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 01, 2021 at 07:04:33AM +0000, Song Bao Hua (Barry Song) wrote: > > > > -----Original Message----- > > From: Greg KH [mailto:gregkh@linuxfoundation.org] > > Sent: Tuesday, June 1, 2021 4:59 PM > > To: tiantao (H) > > Cc: linux-kernel@vger.kernel.org; akpm@linux-foundation.org; Song Bao Hua > > (Barry Song) ; Andy Shevchenko > > ; Rafael J. Wysocki > > Subject: Re: [PATCH 1/2] topology: use bin_attribute to avoid buff overflow > > > > On Tue, Jun 01, 2021 at 10:56:49AM +0800, Tian Tao wrote: > > > Reading sys/devices/system/cpu/cpuX/topology/ returns cpu topology. > > > However, the size of this file is limited to PAGE_SIZE because of the > > > limitation for sysfs attribute. so we use bin_attribute instead of > > > attribute to avoid NR_CPUS too big to cause buff overflow. > > > > > > This patch is based on the following discussion. > > > https://www.spinics.net/lists/linux-doc/msg95921.html > > > > Please use lore.kernel.org for links as we have no control over other > > sites to ensure that they will work in the future. Use the message id > > in the link as well, so that if something were to happen to lore, we can > > figure it out. > > > > Also, you are modifying a bunch of different files here, do you mean to > > do it for all of them? > > The plan is providing a common wrapper similar with cpumap_print_to_pagebuf > so that all modules which have bitmap and list topology ABI can move to use > it. Ok, then create the new function and then convert to use it, do not bundle it together in the same patch. thanks, greg k-h