From patchwork Fri Jun 22 06:41:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10481367 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 44B4560380 for ; Fri, 22 Jun 2018 06:41:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 34D7728705 for ; Fri, 22 Jun 2018 06:41:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2888828D33; Fri, 22 Jun 2018 06:41:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9CE5628A6E for ; Fri, 22 Jun 2018 06:41:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750931AbeFVGlU (ORCPT ); Fri, 22 Jun 2018 02:41:20 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:47464 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750879AbeFVGlT (ORCPT ); Fri, 22 Jun 2018 02:41:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=RV33ju52A5lMPVyq2MDzMwvsJZRZiMA0zp9BQnCnGjg=; b=ptzY+2dcQaAOyby147HnoR/Qs jwuFG5j4QPEgwibknT8UJPFJup/XUuA6s/03nLef8atQJDSe+OeziCpdhbOrSiKiw/ym+WPl/HPul 3VY5hL17BNekpLUST+EAuPUvDVlOcJEqPzDpsXJxY7zFkD4DK4agrMhNDvT70frJSw8RKo+D2EHlz yZfXj0393EfvsKdsCyFlD8iYoBAS/mdMJz8jUHwOIcpyPXQVlkMeoHlzj1u3mAXdpWEmlbIBA/PnJ t68q3CsadWHtPtRrhW5cTdzfTgzKnPTA4AqB+Fv0p7rtHS+/C71/hViTXZqJ4uFoAloPh7ARRhDvO cuxIZUHNQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fWFl0-0006Au-Vc; Fri, 22 Jun 2018 06:41:19 +0000 Date: Thu, 21 Jun 2018 23:41:18 -0700 From: Christoph Hellwig To: "Darrick J. Wong" Cc: linux-xfs@vger.kernel.org Subject: Re: [PATCH 6/8] xfs: fix uninitialized field in rtbitmap fsmap backend Message-ID: <20180622064118.GF27254@infradead.org> References: <152960586416.26246.8634761888260524091.stgit@magnolia> <152960590105.26246.13020311829179912536.stgit@magnolia> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <152960590105.26246.13020311829179912536.stgit@magnolia> User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, Jun 21, 2018 at 11:31:41AM -0700, Darrick J. Wong wrote: > From: Darrick J. Wong > > Initialize the extent count field of the high key so that when we use > the high key to synthesize an 'unknown owner' record (i.e. used space > record) at the end of the queried range we have a field with which to > compute rm_blockcount. This is not strictly necessary because the > synthesizer never uses the rm_blockcount field, but we can shut up the > static code analysis anyway. > > Coverity-id: 1437358 > Signed-off-by: Darrick J. Wong I'd rather ensure the structs are entirely zeroed to start with, e.g.: --- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/xfs/xfs_fsmap.c b/fs/xfs/xfs_fsmap.c index 0299febece9c..21bbdee451a6 100644 --- a/fs/xfs/xfs_fsmap.c +++ b/fs/xfs/xfs_fsmap.c @@ -527,8 +527,8 @@ xfs_getfsmap_rtdev_rtbitmap_query( struct xfs_trans *tp, struct xfs_getfsmap_info *info) { - struct xfs_rtalloc_rec alow; - struct xfs_rtalloc_rec ahigh; + struct xfs_rtalloc_rec alow = { 0, }; + struct xfs_rtalloc_rec ahigh = { 0, }; int error; xfs_ilock(tp->t_mountp->m_rbmip, XFS_ILOCK_SHARED);