Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1898724pxk; Tue, 1 Sep 2020 10:18:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyt4gchsYvHrUTqzCrPilBr7t4RHIXYClzGoPQ1LvHsTEU4RglFKoeumtEJ4yz/7uFWOjjW X-Received: by 2002:a50:bf01:: with SMTP id f1mr2760527edk.369.1598980728173; Tue, 01 Sep 2020 10:18:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598980728; cv=none; d=google.com; s=arc-20160816; b=GbnGJFuMQ016XAk+TMNdfooBUQ+tlwvCMVbpH/LxovO9OegcpffgT0B+2qQtGr8wWw YBtyktweEtpSy7gwxNjFN5vryAxAMe1ysQacq6xZYIh14UF7En4ZXlE1cxek2IAnMDxR dlHV0Z0IUXbcfDjEp3sLuOzHZydZ35yftj7ciBsCWdvX18yFBDlsLAWJfKtBOja5IGcs EY2yc3P3xzS0zLHLHr9q+AB4adGoXgLKkrHDo7IjgVY6HpvzkIlL1yROyUiMaGv9VuGs t1axcZ7qcX1Xio3ZwXAcb/dXHVD/M7FafJltXj36UKJ9mnK1R0RjZRzFaU8HccOpIo1D iMZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=5NSDjPvHYGtSAz1qVUkaGTGlum5M9uXaKlrsehIm+WY=; b=e/dr4jMHc3+VboytT/qCFxKZ/03OjjTSs1yqRE6EsUTSE9lhBP7ULPD5HOAmwYmEie Iw+69mFJVtNOHMMTCWldvcO0mtdDQhgXamDMKpjrt/0pG4SLcQ6mLfz7xlMLBERRz0RR bqVEnegSLfoVcotBVL8DgQfhUlDyp048Ad+xYkPzz2uv3ZvnyDKUr7hCObxdHZeWUHKQ D67nq8xIPuftjeOB1FeJFwVYk73QQK5HDF9JELborrbU+7omXEjbw4xj9DuiA/pyV9dm hbVw3luvqtomlj3XMBx0gzP9Udi5XzPhjEcsOY7VjnV7dnpR/J4N+XuaZZ27sovux6K3 iXPw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l3si1080927ejd.163.2020.09.01.10.18.24; Tue, 01 Sep 2020 10:18:48 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730676AbgIARPt (ORCPT + 99 others); Tue, 1 Sep 2020 13:15:49 -0400 Received: from verein.lst.de ([213.95.11.211]:53778 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729101AbgIAPOq (ORCPT ); Tue, 1 Sep 2020 11:14:46 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id D8B0A68B05; Tue, 1 Sep 2020 17:14:44 +0200 (CEST) Date: Tue, 1 Sep 2020 17:14:44 +0200 From: Christoph Hellwig To: Josef Bacik Cc: hch@lst.de, viro@ZenIV.linux.org.uk, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, willy@infradead.org, kernel-team@fb.com Subject: Re: [PATCH 3/6] proc: allocate count + 1 for our read buffer Message-ID: <20200901151444.GC30709@lst.de> References: <20200813210411.905010-1-josef@toxicpanda.com> <20200813210411.905010-4-josef@toxicpanda.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200813210411.905010-4-josef@toxicpanda.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 13, 2020 at 05:04:08PM -0400, Josef Bacik wrote: > Al suggested that if we allocate enough space to add in the '\0' > character at the end of our strings, we could just use scnprintf() in > our ->proc_handler functions without having to be fancy about keeping > track of space. There are a lot of these handlers, so the follow ups > will be separate, but start with allocating the extra byte to handle the > null termination of strings. > > Signed-off-by: Josef Bacik Looks good, Reviewed-by: Christoph Hellwig