From patchwork Fri Dec 16 20:15:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 13075372 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1490DC001B2 for ; Fri, 16 Dec 2022 20:16:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231952AbiLPUQG (ORCPT ); Fri, 16 Dec 2022 15:16:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231284AbiLPUQE (ORCPT ); Fri, 16 Dec 2022 15:16:04 -0500 Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5935D36C51 for ; Fri, 16 Dec 2022 12:16:03 -0800 (PST) Received: by mail-qt1-x836.google.com with SMTP id a16so3577292qtw.10 for ; Fri, 16 Dec 2022 12:16:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=sxrdrp2AQBozx+ibU551s3/U4/ft7JusEwx9n/BiA4U=; b=bXMfWyDkRf2AHX/gWGBwFZfir3IuAoOR0Nrv4pYMIWs8OrCWM8PRQHqFd/ADaJIoah 0mRvj6+dGi+2Gdjhj1LzLoyJaIx9NeXeuFawtAOsC5hKVzF2DnjQD0GoulqoQj79BL4P cfRmdoDER22R2jJ97Ey9E9a5C+a7MhuCWfAdbHF+ZcPl1CRDih151doz5uKsqEt4ovl9 3V0PfVyieaQAA76Ku6xHye52KG+PkkE1hV0gIWtIJrPx8qOMhCZhE1Buf6x5/6tGdSu6 Zl2Aluf4DDpRI8azmmT3lXqda6RuZZ0/2zHMyzbOqUkim5mBx3F8DKBgFzS/oS4qT3n2 Z8Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sxrdrp2AQBozx+ibU551s3/U4/ft7JusEwx9n/BiA4U=; b=KbUs6OptzhtvuZGyi6umQNQIG4u45Fy6p8/qvW1wSWz3r8yIMaSnAqAv2TnrxRIhsC 1auoYa/3QPqfmYuj9HJ5vovCb7G/vAfzS4naDlb9DvQaPcPFMWjEgKwM1LotE1BFSpBF cb9pjPE0hax/YOPml65W/4000NG1rZhRmuJnox6cIp9knq8oUYRU1NPCeJbjt5kKE6tj flOXnxj6okOsJar9HVAxWEpxV2j4rD0IancSyoxqQ3m+OFk2hQlZgcS1rSLFgvmE0gQi hr1Dk1CqwklRPU4zhBrlT6P6bHl7ZvWyb3UOqvT2UHV+y4bPS3ZjN2DMKDY5bGEzsOfs yGcQ== X-Gm-Message-State: ANoB5pnB4Xr+0JI456k8abrxiCeNopuQS9Uns6ActpGWUKc66IN6pUxZ oDI7Pym82JQ3/oWhGwr+zzVG8sh7M+Ix4lz9nSQ= X-Google-Smtp-Source: AA0mqf4F2vJQ0VlVEvcxLq2SWtSRhjM28Vy6SngULgARQTsjIErWKyOh1f9d7bJdz8RHBYGddUmvCg== X-Received: by 2002:a05:622a:489b:b0:3a6:4e2f:eae7 with SMTP id fc27-20020a05622a489b00b003a64e2feae7mr47904233qtb.10.1671221762147; Fri, 16 Dec 2022 12:16:02 -0800 (PST) Received: from localhost (cpe-174-109-170-245.nc.res.rr.com. [174.109.170.245]) by smtp.gmail.com with ESMTPSA id h17-20020ac85151000000b0039cba52974fsm1771066qtn.94.2022.12.16.12.16.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 12:16:01 -0800 (PST) From: Josef Bacik To: linux-btrfs@vger.kernel.org, kernel-team@fb.com Subject: [PATCH 1/8] btrfs: fix uninit warning in run_one_async_start Date: Fri, 16 Dec 2022 15:15:51 -0500 Message-Id: <5501d33f6ac5af3f371c8734793baeddcde75b4d.1671221596.git.josef@toxicpanda.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org With -Wmaybe-uninitialized complains about ret being possibly uninitialized, which isn't possible, however we can init the value to get rid of the warning. Signed-off-by: Josef Bacik Reviewed-by: Qu Wenruo --- fs/btrfs/disk-io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 0888d484df80..c25b444027d6 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -693,7 +693,7 @@ int btrfs_validate_metadata_buffer(struct btrfs_bio *bbio, static void run_one_async_start(struct btrfs_work *work) { struct async_submit_bio *async; - blk_status_t ret; + blk_status_t ret = BLK_STS_OK; async = container_of(work, struct async_submit_bio, work); switch (async->submit_cmd) { From patchwork Fri Dec 16 20:15:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 13075374 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34F49C46467 for ; Fri, 16 Dec 2022 20:16:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231555AbiLPUQH (ORCPT ); Fri, 16 Dec 2022 15:16:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231657AbiLPUQF (ORCPT ); Fri, 16 Dec 2022 15:16:05 -0500 Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5FC126A99 for ; Fri, 16 Dec 2022 12:16:04 -0800 (PST) Received: by mail-qt1-x829.google.com with SMTP id j16so3614411qtv.4 for ; Fri, 16 Dec 2022 12:16:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=9GkiNo3NR9t33fSWOy/HJNs3H68iO1PgIyTU5GI5al0=; b=Lgx+NQTAJYzKMgV61dcgWlKQgOMRC+9v2Bnbelhh7YlG8H9WHy5gBEILMAopKEBFzu tcRJzRfwMwwVMF185ZhvCxDhWFHEVqjrHvDI7Px4QjPYpHog/HpNxc7NjvUcpapwvy2h 12I+B5cPiGKAYhfMZlj+dLtVoP4W3aYaUGXmYehhm2vProa9NtckIBDbkOBxlZVtuk8f g3BJWgusPNooDp83d+kTRF4tGywJCm04e6D7qwEmFJ0vs0fRN22RAt2/rDs5skLCC5H9 GWZdQz++WpanU7uQIPYzTGIpobp6mDEwEJxJPxTu3UCcXXdf6Ge+UdnGqJPLAMmfcdmJ +oHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9GkiNo3NR9t33fSWOy/HJNs3H68iO1PgIyTU5GI5al0=; b=eC7OrYAD3dllGwaOtOiQDCQCKNxZOIatKE+sGTKGYNjH+k0VT+XzoUOjRf6zBdK9n+ EpePj1dbfKAv5sa1WlA4q1dIaTVACgSakY5WPIp6VjMdtsMZiQkR5wQKnE8bqicStRaY u6Pbn4JZiD6hcvXg6Cabz3gWGePAERizNlf3S2UPpBrNve3PVnz7oFaNziFMooyQNuzp ll/bAkKEDgBKF3pxbshK1ZSiaKrtfpzqey6FP7x66GQPtO51PGAuGXWPGwzmA1ohrc+8 nUv1N4VrxvjzcVH8XCsGLmgNxgEE7pBgZJRcnLM7JUOPCpD+z8UNBl9rIuS7rAs3Givm 3Hzg== X-Gm-Message-State: AFqh2korrBz9isOhSwF6WYXxXPw1QyuBVCzufgKSVDoY4UPuM4Wu5VR+ cvO/r9iXG/BrHAms8Y5+K+tWt8pdk5HJnVUhZr4= X-Google-Smtp-Source: AMrXdXuh9W4z56o1VejOBA7FKJwDRjUgUSJeZ+ZigkrJC3rhs4+A+gT2rqcL5QExqo5lVFdNSjhryQ== X-Received: by 2002:ac8:45da:0:b0:3a9:7cb5:3669 with SMTP id e26-20020ac845da000000b003a97cb53669mr219284qto.32.1671221763500; Fri, 16 Dec 2022 12:16:03 -0800 (PST) Received: from localhost (cpe-174-109-170-245.nc.res.rr.com. [174.109.170.245]) by smtp.gmail.com with ESMTPSA id bq17-20020a05622a1c1100b00397e97baa96sm1888138qtb.0.2022.12.16.12.16.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 12:16:03 -0800 (PST) From: Josef Bacik To: linux-btrfs@vger.kernel.org, kernel-team@fb.com Subject: [PATCH 2/8] btrfs: fix uninit warning in btrfs_cleanup_ordered_extents Date: Fri, 16 Dec 2022 15:15:52 -0500 Message-Id: <8224d05027554e265bb92bd4a7862950e6c7d224.1671221596.git.josef@toxicpanda.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org We can conditionally pass in a locked page, and then we'll use that page range to skip marking errors as that will happen in another layer. However this causes the compiler to complain because it doesn't understand we only use these values when we have the page. Make the compiler stop complaining by setting these values to 0. Signed-off-by: Josef Bacik Reviewed-by: Qu Wenruo Reviewed-by: Johannes Thumshirn --- fs/btrfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 905ea19df125..dfceaf79d5d4 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -228,7 +228,7 @@ static inline void btrfs_cleanup_ordered_extents(struct btrfs_inode *inode, { unsigned long index = offset >> PAGE_SHIFT; unsigned long end_index = (offset + bytes - 1) >> PAGE_SHIFT; - u64 page_start, page_end; + u64 page_start = 0, page_end = 0; struct page *page; if (locked_page) { From patchwork Fri Dec 16 20:15:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 13075375 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BBAFFC4332F for ; Fri, 16 Dec 2022 20:16:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231847AbiLPUQJ (ORCPT ); Fri, 16 Dec 2022 15:16:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231953AbiLPUQH (ORCPT ); Fri, 16 Dec 2022 15:16:07 -0500 Received: from mail-vs1-xe2d.google.com (mail-vs1-xe2d.google.com [IPv6:2607:f8b0:4864:20::e2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36F4461D51 for ; Fri, 16 Dec 2022 12:16:06 -0800 (PST) Received: by mail-vs1-xe2d.google.com with SMTP id k185so3394989vsc.2 for ; Fri, 16 Dec 2022 12:16:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=xP87KjVFI1Zbqnjyi633dm3UZW8/Rhgu6zHUNNN3rlc=; b=YIFQjvZ8gxIOmsxaEG93zu4QRveahYuRZKSlxuhZ0lC+JuaWGRzdXVRTnP2CPBtnDK tC5m5Rh2Pozl2t2wMP2e1bmO+r3Y1J/H5+HqTnBuj+va4CTctiA//aVi4ZaJex9Lq8DK bvpCz/gJow3eOc19LQOE7rKWFtTLUFR1xR61jGzAWcAS33NKCe5cLHOhwb1UlJQBACsr MJ9AMGuAKKwI9dXZgo1vSfdpVstcYW9JV51K9A40PULjACO8iZ8h+hkP9VNqzWLW4mur S7qW8om5A6kHlixbhkdEOYmg3V9HCBPWsOgWMsOnj3HEnTOq3r6yT9r6lzE6hTOnv33j DlSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xP87KjVFI1Zbqnjyi633dm3UZW8/Rhgu6zHUNNN3rlc=; b=FHs0PrqZHCydpNAYDRMNKc8e1pM3DtQ0WXqOdXHlh+wtGGwZHy8ylL5wmr8LToeusb gcxO3TUvVaseyD7wy2LHpb6MJTqobW9vH2nh6VZkXAmY9J3joG+bJ8ErtgUtwulXMGCm CmSj02PUg2CdmxyqxD8bgNUOYmAZt+i8H+kb/VSx1CVDivZMHwDUAoS7gN/00omwFuiS lsOTXEkbsgr36bi+cASKUpC64vke+rRJTuGqyqnFmAIcGCtNb4ZFaO1Jmm9wP3Kiftis +mZAKZszbs5DbJvpGpoK9jvMTO1TIkloriaKUI5/2/sq5pWnjz1YoPu4C/pMxBsBwo3M mBXQ== X-Gm-Message-State: ANoB5pmWG/Zjr5IQ2S0PQw/ZT/zVYioDNgLBOyTKC9X3excoj6MDNT5q iMxNlN3ATowpSkHewKXa7urbk5mpGaBe/p+ZJQE= X-Google-Smtp-Source: AA0mqf5sVZzpwOI/OrWl6jfoC7CJycymivCYIcl7+cDjueSpWkNFk2JqnZEQZDzQB0Yd6Fssyi7wWA== X-Received: by 2002:a67:ffcb:0:b0:3b1:48fc:e033 with SMTP id w11-20020a67ffcb000000b003b148fce033mr22907423vsq.2.1671221764858; Fri, 16 Dec 2022 12:16:04 -0800 (PST) Received: from localhost (cpe-174-109-170-245.nc.res.rr.com. [174.109.170.245]) by smtp.gmail.com with ESMTPSA id dt20-20020a05620a479400b006fbf88667bcsm2105656qkb.77.2022.12.16.12.16.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 12:16:04 -0800 (PST) From: Josef Bacik To: linux-btrfs@vger.kernel.org, kernel-team@fb.com Subject: [PATCH 3/8] btrfs: fix uninit warning from get_inode_gen usage Date: Fri, 16 Dec 2022 15:15:53 -0500 Message-Id: X-Mailer: git-send-email 2.26.3 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Anybody that calls get_inode_gen() can have an uninitialized gen if there's an error. This isn't a big deal because all the users just exit if they get an error, however it makes -Wmaybe-uninitialized complain, so fix this up to always init the passed in gen, this quiets all of the uninitialized warnings in send.c. Signed-off-by: Josef Bacik Reviewed-by: Qu Wenruo Reviewed-by: Johannes Thumshirn --- fs/btrfs/send.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index 67f7c698ade3..25a235179edb 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -955,14 +955,12 @@ static int get_inode_info(struct btrfs_root *root, u64 ino, static int get_inode_gen(struct btrfs_root *root, u64 ino, u64 *gen) { int ret; - struct btrfs_inode_info info; + struct btrfs_inode_info info = {}; - if (!gen) - return -EPERM; + ASSERT(gen); ret = get_inode_info(root, ino, &info); - if (!ret) - *gen = info.gen; + *gen = info.gen; return ret; } From patchwork Fri Dec 16 20:15:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 13075376 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9E72C4332F for ; Fri, 16 Dec 2022 20:16:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231893AbiLPUQN (ORCPT ); Fri, 16 Dec 2022 15:16:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231703AbiLPUQJ (ORCPT ); Fri, 16 Dec 2022 15:16:09 -0500 Received: from mail-vs1-xe2d.google.com (mail-vs1-xe2d.google.com [IPv6:2607:f8b0:4864:20::e2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 977BB59179 for ; Fri, 16 Dec 2022 12:16:07 -0800 (PST) Received: by mail-vs1-xe2d.google.com with SMTP id f189so3339842vsc.11 for ; Fri, 16 Dec 2022 12:16:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=83z1jbNn1BgygXOpq0wKfWJrITE303JrObzgqLZM5IM=; b=4imRgUBQ6aGWu793jb7cr3YdNhL6pKvuNmxSmAEB1dyCjADBT2teiVWaBCHnnut1BI UmV0iRuF1C+dNI0Bkhyy2HSaEvUi8r1ERpZ0jNRwt8JaIF8JGIqTOJtMtWx6GDu38ag6 xA6dx6UzKClXNIpVt+zD5lpKFCCP2cHZqFmIIA88tak7xSuiyvtEeluuggEB/m1ioVrm 248YIlNwDOZ5LmqGiw1dDFjlro1qYuGhBXaWylF41RsQHKzCrdVpxTTHsT2yAbHb7ym5 6BC0Qr2N3LhfDEY9LRnUKzsomdE37EGzvKHNGLMf9LD03QaFKD/XWDKWb33RxcHTz7v4 IHKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=83z1jbNn1BgygXOpq0wKfWJrITE303JrObzgqLZM5IM=; b=utHmjInoCpUAlMi2kXmV/0QCGe+3NTvGfOboRMNlmhKyT7NhCU49acl4nEo9/SU3NA E20gjpK4+tRYEWJDmvOLwFZWDOjLtlWt4p+urMouBroCzd71vZn4rWotwEjyZ9GSTbzg ME8GffW0eXF4/8l6JqZo0ZGmCbL77hhbBuTqabLME+almaQcRrhjUBio+RJ3in4w5IsN UssNLGmoiv7un8ToqKETRjVEeBYp9yk0Bw+q/5UoeYj57qPrzxQofNdTxbw5pXI6fNoT QwS/WpfVaJ4mKvyVRg3QjTwlg/6JW6jTf0j1theneW5YyyVLCq7Dd3FCuvmM8yuJwes9 Sz0w== X-Gm-Message-State: ANoB5pk2OdHbjp1Nm58pHDRHUqqXMkzFGm6cULW/iKJvOSBUiirrhB4S 4NQJhPzDWI9LIYGHHXNjqRWhJXnNQLrrJQ9nYOY= X-Google-Smtp-Source: AA0mqf5AIUUb3TVI2V6BwRHmVuThiKszWFG62XkbKWruWumtGOhwjf7BgfHuy2TJiRGpkpisqXsc0g== X-Received: by 2002:a67:f04a:0:b0:3b3:7657:43a1 with SMTP id q10-20020a67f04a000000b003b3765743a1mr13728205vsm.19.1671221766371; Fri, 16 Dec 2022 12:16:06 -0800 (PST) Received: from localhost (cpe-174-109-170-245.nc.res.rr.com. [174.109.170.245]) by smtp.gmail.com with ESMTPSA id do25-20020a05620a2b1900b006ff8c632259sm2139202qkb.42.2022.12.16.12.16.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 12:16:05 -0800 (PST) From: Josef Bacik To: linux-btrfs@vger.kernel.org, kernel-team@fb.com Subject: [PATCH 4/8] btrfs: fix uninit warning in btrfs_update_block_group Date: Fri, 16 Dec 2022 15:15:54 -0500 Message-Id: <87302b559838af285024d47b3b738ef36ad0ebe4.1671221596.git.josef@toxicpanda.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org reclaim isn't set in the alloc case, however we only care about reclaim in the !alloc case. This isn't an actual problem, however -Wmaybe-uninitialized will complain, so initialize reclaim to quiet the compiler. Signed-off-by: Josef Bacik Reviewed-by: Qu Wenruo Reviewed-by: Johannes Thumshirn --- fs/btrfs/block-group.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c index 708d843daa72..e90800388a41 100644 --- a/fs/btrfs/block-group.c +++ b/fs/btrfs/block-group.c @@ -3330,7 +3330,7 @@ int btrfs_update_block_group(struct btrfs_trans_handle *trans, spin_unlock(&info->delalloc_root_lock); while (total) { - bool reclaim; + bool reclaim = false; cache = btrfs_lookup_block_group(info, bytenr); if (!cache) { From patchwork Fri Dec 16 20:15:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 13075377 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E76ABC4167B for ; Fri, 16 Dec 2022 20:16:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231954AbiLPUQO (ORCPT ); Fri, 16 Dec 2022 15:16:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231949AbiLPUQK (ORCPT ); Fri, 16 Dec 2022 15:16:10 -0500 Received: from mail-vk1-xa2b.google.com (mail-vk1-xa2b.google.com [IPv6:2607:f8b0:4864:20::a2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CC114F64F for ; Fri, 16 Dec 2022 12:16:09 -0800 (PST) Received: by mail-vk1-xa2b.google.com with SMTP id l17so1657004vkk.3 for ; Fri, 16 Dec 2022 12:16:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=vi7yDEePu3S4Igbj5SApT40uXZ+IL2v9Cf3SK7Kgwvg=; b=QlNDdU8S7jArd5G5DqbN7PmUdIFSjigAcUEsij0BjRIntD5TvsMRVM0UylOCm8OXZf EqXCXrimCrkVzfMtDs4Y2SnYAoTCVgfxpigDfpDzGX1QlRlS+lzjmdZQxzgDRk/jikkp bBLq+1jHgJlkxAD5RMIRLyeuBTrKIbtcXqPNurIYKoATw9BQmAItwT7H5lGBYIHy3TT0 E2sKFqSBxQHXcr0Iy6kl5bpUjExhTtdsdyx8AgxHTwewPdiX2cLAZU1cCAIzvc6/VeX+ Pe8Dj9dAUJdQXmWgzjZG3giKzoHaWVE8VCgkQZnZIx4+sEyFxvRw263WZgIcC5WmwJS1 HSRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vi7yDEePu3S4Igbj5SApT40uXZ+IL2v9Cf3SK7Kgwvg=; b=nvDmN5wf9jjqqBhPuSslyCt6erl+joMZKJJ5bHanREuVce4CHoV2Q/fcTa9JAsMQP7 r2j6i0zGqAuaTrgxMiqgS6NBRbKx3EQ156VuihGw4ajVfoedrRGKlRu2YUuD807C2lRm fDwqmFTRHhWMQbA+Qv5unNciQNrzRFUFOOP2nA6f9YPOo/tPgmBoGbRndrmLqCD+huoq uRYMhwcI/dJr19uJ4ubmnX9+fK81xjgySWlXxHrMLhOxLZq3etvUoFwX/BzinW++SyjX G5t/dwIPh5+/kPvyBI+1aoq3JTpk/cCrYPGHUABSCdasZ7ZySv1Szl+Vqoo++ffqVuel OcPQ== X-Gm-Message-State: ANoB5pkBlOcFMYhYZ918wwvsGWzHF3yBiKkYJ+pt1/n8BnUp7PeV3b5V ktcEZG61S8owHHEakYsZLUkvG1tO9mJP2MSihsw= X-Google-Smtp-Source: AA0mqf57VYKW9J8/QmbI8tpx4/8zAMvAJ0IyqJU6Vla2+H2T5hyRvMz493SIb4N5gnKFtrdIrkuRRQ== X-Received: by 2002:a1f:9b87:0:b0:3bc:a30d:9248 with SMTP id d129-20020a1f9b87000000b003bca30d9248mr19517101vke.9.1671221767914; Fri, 16 Dec 2022 12:16:07 -0800 (PST) Received: from localhost (cpe-174-109-170-245.nc.res.rr.com. [174.109.170.245]) by smtp.gmail.com with ESMTPSA id x20-20020a05620a449400b006eef13ef4c8sm2205997qkp.94.2022.12.16.12.16.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 12:16:07 -0800 (PST) From: Josef Bacik To: linux-btrfs@vger.kernel.org, kernel-team@fb.com Subject: [PATCH 5/8] btrfs: fix uninit warning in __set_extent_bit and convert_extent_bit Date: Fri, 16 Dec 2022 15:15:55 -0500 Message-Id: <02a60dacc01beb1ab14845f2b579e4b6f56c6359.1671221596.git.josef@toxicpanda.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org We will pass in the parent and p pointer into our tree_search function to avoid doing a second search when inserting a new extent state into the tree. However because this is conditional upon passing in these pointers the compiler seems to think these values can be uninitialized if we're using -Wmaybe-uninitialized. Fix this by initializing these values. Signed-off-by: Josef Bacik Reviewed-by: Qu Wenruo --- fs/btrfs/extent-io-tree.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/extent-io-tree.c b/fs/btrfs/extent-io-tree.c index 9ae9cd1e7035..9e1f18706a02 100644 --- a/fs/btrfs/extent-io-tree.c +++ b/fs/btrfs/extent-io-tree.c @@ -972,8 +972,8 @@ static int __set_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, { struct extent_state *state; struct extent_state *prealloc = NULL; - struct rb_node **p; - struct rb_node *parent; + struct rb_node **p = NULL; + struct rb_node *parent = NULL; int err = 0; u64 last_start; u64 last_end; @@ -1218,8 +1218,8 @@ int convert_extent_bit(struct extent_io_tree *tree, u64 start, u64 end, { struct extent_state *state; struct extent_state *prealloc = NULL; - struct rb_node **p; - struct rb_node *parent; + struct rb_node **p = NULL; + struct rb_node *parent = NULL; int err = 0; u64 last_start; u64 last_end; From patchwork Fri Dec 16 20:15:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 13075378 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CFFF0C001B2 for ; Fri, 16 Dec 2022 20:16:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231140AbiLPUQP (ORCPT ); Fri, 16 Dec 2022 15:16:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231953AbiLPUQL (ORCPT ); Fri, 16 Dec 2022 15:16:11 -0500 Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A278659B3 for ; Fri, 16 Dec 2022 12:16:10 -0800 (PST) Received: by mail-qt1-x836.google.com with SMTP id a16so3577529qtw.10 for ; Fri, 16 Dec 2022 12:16:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=eRj2OndmReLHyD2b6N31Fk0hqgMcbE8LEKZdUR1+ksc=; b=oD1mfSPOdtJgKnQGNAHxGKB8r8A0T+Oj26OHdGD/owYbmO33h0Ltyb028aei6dXJ4b bUDCh+nRKMfnQbuPRbzR00lD69lG20rpHm3oxnv1TO4D7HY2XsouXj8XfyX8H31O6rM+ Qk+HotqI0sJ6NLt06Gn22RZIULYFYG1YlIf3+S/j6Sak48nbVrp+5kGAuUaybHIQeCfA Rmb/SVI+xYDAgZTTvos7wsfGucHzm/fh7ZvnS6fScxZ+RmIWD45yArLdnFeGtRZFqdEL fwgHos7VzLOGbvbvf7R6EFFkRX5u1IhLIChKdgDX+XPExyR09oYnHjhBKI/NecSzDdmb mPnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eRj2OndmReLHyD2b6N31Fk0hqgMcbE8LEKZdUR1+ksc=; b=KvLi2ma9taryGQ6kTnERTQ4xaIEV0m+CWar5tsQT2khoz79Vrj3W58haZ61rue54Ys AfgGmgYYqSKH273dzfq+sgggNGxqntCik+X5pSCTQ2fRWz/ovuW51a9Ysqpr+j8m/Gxu kZrh9ZlSeIH5GT9Pi3mpneF3VTrH9f3eez3lgf0LkbO2qCBewc/hF0IMMVWjvbJWw64L 28ZQjchPAYgJiNYl3FhHgpkXgrdDLAPM3Eaif4XdxfmrAyiaBkfG2/fKcIxDtewCkeNi 9ICf2aisPS+iIBSZwr7SO1LcKlURzOBN+ZEJjPzmo9zFaiHhTRyjoWyKQm7GBERUqMgk EKFQ== X-Gm-Message-State: AFqh2kqr0zFbMX2W4URqbtmGL1by18eCGYUxU7ip3JNXSBy/Xl057FwP eVzFmc+UOFXxywGVQPPuGdQsZ2RZGUr18g91iqQ= X-Google-Smtp-Source: AMrXdXtulDeu8SBFBNMIlg3mJNxVTaoPuZUCUsYqfs+x0I3lhG6bcGxO4EPSngvriDRPbBdXEjssQw== X-Received: by 2002:a05:622a:1c14:b0:3a7:ee04:9ea7 with SMTP id bq20-20020a05622a1c1400b003a7ee049ea7mr962255qtb.16.1671221769360; Fri, 16 Dec 2022 12:16:09 -0800 (PST) Received: from localhost (cpe-174-109-170-245.nc.res.rr.com. [174.109.170.245]) by smtp.gmail.com with ESMTPSA id r3-20020a05620a03c300b006eed75805a2sm2019807qkm.126.2022.12.16.12.16.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 12:16:08 -0800 (PST) From: Josef Bacik To: linux-btrfs@vger.kernel.org, kernel-team@fb.com Subject: [PATCH 6/8] btrfs: extract out zone cache usage into it's own helper Date: Fri, 16 Dec 2022 15:15:56 -0500 Message-Id: X-Mailer: git-send-email 2.26.3 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org There's a special case for loading the device zone info if we have the zone cache which is a fair bit of code. Extract this out into it's own helper to clean up the code a little bit, and as a side effect it fixes an uninitialized error we get with -Wmaybe-uninitialized where it thought zno may have been uninitialized. Signed-off-by: Josef Bacik Reported-by: Josef Bacik Signed-off-by: Naohiro Aota --- fs/btrfs/zoned.c | 73 +++++++++++++++++++++++++++++------------------- 1 file changed, 45 insertions(+), 28 deletions(-) diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c index a759668477bb..f3640ab95e5e 100644 --- a/fs/btrfs/zoned.c +++ b/fs/btrfs/zoned.c @@ -216,11 +216,46 @@ static int emulate_report_zones(struct btrfs_device *device, u64 pos, return i; } +static int load_zones_from_cache(struct btrfs_zoned_device_info *zinfo, u64 pos, + struct blk_zone *zones, unsigned int *nr_zones) +{ + unsigned int i; + u32 zno; + + if (!zinfo->zone_cache) + return -ENOENT; + + ASSERT(IS_ALIGNED(pos, zinfo->zone_size)); + zno = pos >> zinfo->zone_size_shift; + + /* + * We cannot report zones beyond the zone end. So, it is OK to + * cap *nr_zones to at the end. + */ + *nr_zones = min_t(u32, *nr_zones, zinfo->nr_zones - zno); + + for (i = 0; i < *nr_zones; i++) { + struct blk_zone *zone_info; + + zone_info = &zinfo->zone_cache[zno + i]; + if (!zone_info->len) + break; + } + + if (i == *nr_zones) { + /* Cache hit on all the zones */ + memcpy(zones, zinfo->zone_cache + zno, + sizeof(*zinfo->zone_cache) * *nr_zones); + return 0; + } + + return -ENOENT; +} + static int btrfs_get_dev_zones(struct btrfs_device *device, u64 pos, struct blk_zone *zones, unsigned int *nr_zones) { struct btrfs_zoned_device_info *zinfo = device->zone_info; - u32 zno; int ret; if (!*nr_zones) @@ -233,32 +268,8 @@ static int btrfs_get_dev_zones(struct btrfs_device *device, u64 pos, } /* Check cache */ - if (zinfo->zone_cache) { - unsigned int i; - - ASSERT(IS_ALIGNED(pos, zinfo->zone_size)); - zno = pos >> zinfo->zone_size_shift; - /* - * We cannot report zones beyond the zone end. So, it is OK to - * cap *nr_zones to at the end. - */ - *nr_zones = min_t(u32, *nr_zones, zinfo->nr_zones - zno); - - for (i = 0; i < *nr_zones; i++) { - struct blk_zone *zone_info; - - zone_info = &zinfo->zone_cache[zno + i]; - if (!zone_info->len) - break; - } - - if (i == *nr_zones) { - /* Cache hit on all the zones */ - memcpy(zones, zinfo->zone_cache + zno, - sizeof(*zinfo->zone_cache) * *nr_zones); - return 0; - } - } + if (!load_zones_from_cache(zinfo, pos, zones, nr_zones)) + return 0; ret = blkdev_report_zones(device->bdev, pos >> SECTOR_SHIFT, *nr_zones, copy_zone_info_cb, zones); @@ -274,9 +285,15 @@ static int btrfs_get_dev_zones(struct btrfs_device *device, u64 pos, return -EIO; /* Populate cache */ - if (zinfo->zone_cache) + if (zinfo->zone_cache) { + u32 zno; + + ASSERT(IS_ALIGNED(pos, zinfo->zone_size)); + zno = pos >> zinfo->zone_size_shift; + memcpy(zinfo->zone_cache + zno, zones, sizeof(*zinfo->zone_cache) * *nr_zones); + } return 0; } From patchwork Fri Dec 16 20:15:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 13075379 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6785C4332F for ; Fri, 16 Dec 2022 20:16:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230219AbiLPUQS (ORCPT ); Fri, 16 Dec 2022 15:16:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231960AbiLPUQQ (ORCPT ); Fri, 16 Dec 2022 15:16:16 -0500 Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com [IPv6:2607:f8b0:4864:20::831]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78AA9659AE for ; Fri, 16 Dec 2022 12:16:12 -0800 (PST) Received: by mail-qt1-x831.google.com with SMTP id x11so3564719qtv.13 for ; Fri, 16 Dec 2022 12:16:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=SeGRpLFBCU9iZeaT6l+8kozEZPYFZQ++TCDegxZyd5g=; b=PQ2+L5Njo1yhp7XK9Fw9mwLudEAg7zalU9mVhM7D/gEM5oE4PjmwNQkbs2C/qoXGOB 72Zr9p9BobHOc+b2dF52NMVVnn7BrQHxWez1j/QAYsk1IAHlBm70xZg5Wk1+QS5+RX/1 dWuY9UQSWAxbnuGgOpg0L7ArY67w2sHgQB/9VFUa0hfwD71d2sk8Ok9UKXq+Q5siztWy go/UxG/BUdGggsNQP9TaE8vLhsICZmuXeZbmmAOOm6RPWH/mpJ37IQ1txmrokKvO0n/Q yDH0G5FciAMyqjdcBPjv5NXsrcWv1Mrx6Bc9a4+EweGUZ+mG52hS8/Ft/S2vx4/7ho/y gWLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SeGRpLFBCU9iZeaT6l+8kozEZPYFZQ++TCDegxZyd5g=; b=FioS2vKkPEl/jSOL2MSOuaf4beo6QgqQLVKYh9ZPhuIksTpUWu4blDVQYE24KQvgoS lG85THvgST337y7CYoMvNaiAKc2g2PR3rD1yfgXwoX89BeV2rA0qTwflc29/o+Y3UZke CIh53cE4z847FpU0eR2I7hv2z2krT0TUy7WvBIFhHF3yVasJaRURA/8Bvcij4Ftg1XtY +lHz1wpsgN9fWArkd8xgIb0JipS3kvt4i7uDcCkQbPMu7bFvX7C3bZ27FCn/zgNByjPu 70cdvqrKUtWoanMSgJ5pNw8tfgbJTyLMidpj9t7MJo3MQLcUA7TJaxJZeM9D0NVE0E5X NnZA== X-Gm-Message-State: AFqh2kpKoUFXrmkijtw0EH354DZq6Y/Se9qixt1TeYBj8dpy4DnH5Kn5 J+DbUisygQExk0pz6VoVKPn54ZnRL074rUTkXDk= X-Google-Smtp-Source: AMrXdXsVozMEUimTYhN834XRyqlt0hEqTkXKghix5rJ1GlMvC3X96uVb/nOqHi5jiLQaKEKYO+sjeA== X-Received: by 2002:a05:622a:59ce:b0:3a7:f091:bfe with SMTP id gc14-20020a05622a59ce00b003a7f0910bfemr1474506qtb.7.1671221770781; Fri, 16 Dec 2022 12:16:10 -0800 (PST) Received: from localhost (cpe-174-109-170-245.nc.res.rr.com. [174.109.170.245]) by smtp.gmail.com with ESMTPSA id ew14-20020a05622a514e00b003a5430ee366sm1890564qtb.60.2022.12.16.12.16.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 12:16:10 -0800 (PST) From: Josef Bacik To: linux-btrfs@vger.kernel.org, kernel-team@fb.com Subject: [PATCH 7/8] btrfs: fix uninit warning in btrfs_sb_log_location Date: Fri, 16 Dec 2022 15:15:57 -0500 Message-Id: <81030329cd7526ec374fa4e76ac6bc4b0ed56e25.1671221596.git.josef@toxicpanda.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org We only have 3 possible mirrors, and we have ASSERT()'s to make sure we're not passing in an invalid super mirror into this function, so technically this value isn't uninitialized. However -Wmaybe-uninitialized will complain, so set it to U64_MAX so if we don't have ASSERT()'s turned on it'll error out later on when it see's the zone is beyond our maximum zones. Signed-off-by: Josef Bacik Reviewed-by: Naohiro Aota Reviewed-by: Johannes Thumshirn --- fs/btrfs/zoned.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c index f3640ab95e5e..54568735415d 100644 --- a/fs/btrfs/zoned.c +++ b/fs/btrfs/zoned.c @@ -160,7 +160,7 @@ static int sb_write_pointer(struct block_device *bdev, struct blk_zone *zones, */ static inline u32 sb_zone_number(int shift, int mirror) { - u64 zone; + u64 zone = U64_MAX; ASSERT(mirror < BTRFS_SUPER_MIRROR_MAX); switch (mirror) { From patchwork Fri Dec 16 20:15:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 13075380 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A2A45C001B2 for ; Fri, 16 Dec 2022 20:16:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231955AbiLPUQT (ORCPT ); Fri, 16 Dec 2022 15:16:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231961AbiLPUQQ (ORCPT ); Fri, 16 Dec 2022 15:16:16 -0500 Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78CC9659B5 for ; Fri, 16 Dec 2022 12:16:13 -0800 (PST) Received: by mail-qt1-x836.google.com with SMTP id jr11so3594135qtb.7 for ; Fri, 16 Dec 2022 12:16:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=zuaPXloxLhAftLUFO5H+ZxRIJ1ioDiYP8OOa8CufXVw=; b=Vdk+ROI9+zPolLsEFnqa7XX3bgap2URPsCrjGUItbQBOJm62nhHG3Oq8omfa840USy ZbGlvV+TpW3MNu8tShwlKrCEJvo4itbS4eEDqMZkMWk1XTxLqbRu98l+YAHR3lHEJIhc 3w4leEEW8Gwx1Ebh89iHD/W4eTDl9JVyP8OLCjND9DWS6w6ndvYVIu5+YHli6zcBHg72 QfMTsAxYrIpCfhp9mTIIxZqViijRaQ4g6kfMta6Q0b6aLu7vnbKA+BCJrbwrzwH2BZHF LuOuDuMU8YEybwy8SM8TLVyYWmkcXBq1y3MbVaSHfNEPrgtMyOfOwr8c9OfV7tZOudB5 EFxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zuaPXloxLhAftLUFO5H+ZxRIJ1ioDiYP8OOa8CufXVw=; b=TaoRrsBbEhDMqQNRHDEoz1GJIc9RRyjNy+zmjX7YZqAKyRSPNHImLSkkFD9KlYuB/1 n+I7x2pihj1X9qEQbu8d+JzEWy3Fs7mD8CresVohbhdAIlUGYYKYtIwwEku/7AsGxk15 PQDVA47tQ2xy2rgHXeJCTumzYDSZskSnKRhmhxwpGDpCFJ9cgBoi5a7UbPdoYTq1bZ9P 3Xl52n12aAalcR5MVNsgNV4/2wnD8eQKJc00UcWBgqIGnesJpmrr+mR2VqnY6djYahN+ iHH5RXOYtM/9uTCOC85D0ztAgZ9r5PGpQ/qwIXcoXAjKiD+Px71+DDZymDPiHtWdqb5i j72g== X-Gm-Message-State: AFqh2koeExB2ScVhdZZka0Y0ggTo8yPJ1C2GncT8ZfSG4Cv6MxbOPxPa 8DNaTV/hPRCyXYRIeC4fwd2T9+5oqbV0pQVN+cY= X-Google-Smtp-Source: AMrXdXtvHk7X41DyI557Rl/38pEJFEi54YOJNG5qoIKT8SbmgBC6zyhTedhb2lR4cgDVf6XpUZFrOA== X-Received: by 2002:ac8:6683:0:b0:3a9:6b73:fb91 with SMTP id d3-20020ac86683000000b003a96b73fb91mr8862154qtp.64.1671221772111; Fri, 16 Dec 2022 12:16:12 -0800 (PST) Received: from localhost (cpe-174-109-170-245.nc.res.rr.com. [174.109.170.245]) by smtp.gmail.com with ESMTPSA id fu25-20020a05622a5d9900b003a57eb7f212sm1849891qtb.10.2022.12.16.12.16.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 12:16:11 -0800 (PST) From: Josef Bacik To: linux-btrfs@vger.kernel.org, kernel-team@fb.com Subject: [PATCH 8/8] btrfs: turn on -Wmaybe-uninitialized Date: Fri, 16 Dec 2022 15:15:58 -0500 Message-Id: <1d9deaa274c13665eca60dee0ccbc4b56b506d06.1671221596.git.josef@toxicpanda.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org We had a recent bug that would have been caught by a newer compiler with -Wmaybe-uninitialized and would have saved us a month of failing tests that I didn't have time to investigate. Signed-off-by: Josef Bacik Reviewed-by: Qu Wenruo --- fs/btrfs/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/btrfs/Makefile b/fs/btrfs/Makefile index 555c962fdad6..eca995abccdf 100644 --- a/fs/btrfs/Makefile +++ b/fs/btrfs/Makefile @@ -7,6 +7,7 @@ subdir-ccflags-y += -Wmissing-format-attribute subdir-ccflags-y += -Wmissing-prototypes subdir-ccflags-y += -Wold-style-definition subdir-ccflags-y += -Wmissing-include-dirs +subdir-ccflags-y += -Wmaybe-uninitialized condflags := \ $(call cc-option, -Wunused-but-set-variable) \ $(call cc-option, -Wunused-const-variable) \