Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3682053rdh; Tue, 28 Nov 2023 00:20:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IGTnn4BnegjyhixtY3HP2rhI4GgLugv9ik2/n2koB9HNfzBe+YFm10Nuh4xiVsO/tmJKGPV X-Received: by 2002:a05:6870:f783:b0:1ea:c913:3494 with SMTP id fs3-20020a056870f78300b001eac9133494mr20755524oab.6.1701159599963; Tue, 28 Nov 2023 00:19:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701159599; cv=none; d=google.com; s=arc-20160816; b=NRVcTVTx3wi8usWxpOKIXiZvHdwnrOrcv2OlQZoFNlCy2y6WPS5yLqlo2noJVjZK4f 9wdp3xMJ871mzTjLmNeOgTKY/CPUe8igbmtHRHLv6eLZ3gJUJ+X3ovK1EN1X8BPYq4bY hDTyDsdjdz37r6tPTZ43ODaiF8D3UuDDV2Dpj18N7TJ2LzfwWu09HD+54WCVfXum6kYW lW/LwHgkO0Gx9r3iUfd7xDPBThMNHE0zSbTiYaDA8qgW0EAmC/cyVCM63jDo/lFI8HW6 CG8YQq7E6EC6w4+FrUk05nrOggI2Bfjyab7HfZAlC8QRfoXKT2KZ0bF/UpKJoyOAdcSP 2CGQ== 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=6P7w5SEBilFSlHhNw2KzHq6PLTIxmHl6RL+UUL/42O4=; fh=fj0qAbZ4xhXorrWATNz35M5L5SZ9Tnytk+Yr0llgXF0=; b=M+zU3lWdSwyY6nnmDo1DZ4BHlI/NrD4FQaKJdxKf20hMdUuwbddf1if6reLTE/62RD 85IC8iRf23bfQXNCGFlb+Ysk2eElbLZcAOSK8oU2CfGBdnfHqyle2Vgr4KyEjdt1xlWs rRm2i0jo/eopJkcwkWhRqsKRQi9Xw/M8fBtUiJ6Q7QuRL5dfJ7EqyJ5c8bPcF0yqTxLH ysppQpWRUXug+YCagBjyhe0GzF9R4CMQaDUx4A6oRtjWy6zMM9WPofByj2VSuVZEt8fB AvnaF0v2zeCPDs8ia7bD+Hg+t0OCJuYkziE3f4dm9PW3gR5ha2PHEQJ+hp83JEGbRuRc BnTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=QSsHW+cm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id j15-20020a056a00130f00b006cbbdc31d10si11903795pfu.220.2023.11.28.00.19.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 00:19:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=QSsHW+cm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 75431807C57E; Tue, 28 Nov 2023 00:19:57 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344090AbjK1ITl (ORCPT + 99 others); Tue, 28 Nov 2023 03:19:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344116AbjK1ITg (ORCPT ); Tue, 28 Nov 2023 03:19:36 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 061E018D; Tue, 28 Nov 2023 00:19:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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; bh=6P7w5SEBilFSlHhNw2KzHq6PLTIxmHl6RL+UUL/42O4=; b=QSsHW+cmFxrltLh/f9Lb0TdNQW XB3OQhlSlav/WP4TYeNIpcrr31tzYQwifoM59bijQl+S3EIRO4exXXa81GwpjXIQZ9m3PV9UBZ50F +3goC+gwiuixCxTD6YW8VOJtjLCRxfJG1KZO6k9FFyAd0FkS84JYPcwSiCrMfQ+zz3uyFWWXvDaYG toChNVC0eN9plO/QuqPh/DCV9fs8CYsNs6xpVQbH4LmChjO76dK/ZbHFZOxXusVG+kLlyo9WJ/Ylp S1kHVMBjGOkrUtZxPD7OJVSh5XKKYhYcIxlUBQqMfC2geJtiN8sM+CjS2dvhR9kfOH1k8iSh8ER7P Ga4zG69w==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1r7tJT-004W5m-1Z; Tue, 28 Nov 2023 08:19:23 +0000 Date: Tue, 28 Nov 2023 00:19:23 -0800 From: Christoph Hellwig To: Jiachen Zhang Cc: Chandan Babu R , "Darrick J. Wong" , Dave Chinner , Allison Henderson , Zhang Tianci , Brian Foster , Ben Myers , linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org, xieyongji@bytedance.com, me@jcix.top Subject: Re: [PATCH 1/2] xfs: ensure tmp_logflags is initialized in xfs_bmap_del_extent_real Message-ID: References: <20231128053202.29007-1-zhangjiachen.jaycee@bytedance.com> <20231128053202.29007-2-zhangjiachen.jaycee@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231128053202.29007-2-zhangjiachen.jaycee@bytedance.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 28 Nov 2023 00:19:57 -0800 (PST) On Tue, Nov 28, 2023 at 01:32:01PM +0800, Jiachen Zhang wrote: > In the case of returning -ENOSPC, ensure tmp_logflags is initialized by 0. > Otherwise the caller __xfs_bunmapi will set uninitialized illegal > tmp_logflags value into xfs log, which might cause unpredictable error > in the log recovery procedure. This looks good: Reviewed-by: Christoph Hellwig But I wonder if removing the local flags variable and always directly assigning to *logflagsp might be more robust in the long run.