Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2953602rdb; Tue, 13 Feb 2024 02:17:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IHTs6iN3WqMKpTL8w0uUHdH5UE5UoIbdTmGbj5DFu/1NIoz1gEX4gecLEZJNVKOx+Ds2UeH X-Received: by 2002:a05:620a:1a2a:b0:785:b02b:5e16 with SMTP id bk42-20020a05620a1a2a00b00785b02b5e16mr12390026qkb.15.1707819469885; Tue, 13 Feb 2024 02:17:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707819469; cv=pass; d=google.com; s=arc-20160816; b=0bG5rD139b0mYNBNHGzKABQicpWREqXJ4ldSEJfUad7L1bDXJUSrKRUyWcd8FiffS6 k5Tsey2q0jQW3OhpyRvIbt/++dUAzdPaAlTNGcmcn3q8jwnXZs3NhMnjsbm0QjXrcf8m YksYn7KJU6do5PEbKmuhI14U2/pYuAZ7w4AEgmacd9SVtAAuXdsXCNs24dvYSOkH2+m9 3kY6qumsvYYLk9sAODR9GXKn0jWyDAVRX/ZCs5DjklYP4GEyIhCALa3SpH5HCqZb13Jc bNaLaFLjoQy2k36WD8dUn3I4jpfaidAVdqXo9ObcqM2z0g76YRi5vbiStnZ6S3zAlKgp NT9A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=wN+/qhHzwUoiJ12jHQid2Iv5evqadbysnb5i9GBBNKA=; fh=/drcCv8JGU9+hvYDTp3OU3tpMyYB06xsBIqrPdL641Y=; b=rC0hFbLn/sGyqMenIhID3emwCpoEeptQLj9rOBLXc2ifz4CUmmaDfv6rTZdeXNxYbu iaEL7UdYyQ7g9eNUKCL7MYuMe7pWQ2bgJSiApnh+rRFoDYIQFUec55R4cvRQJvczjLI9 dxheVpvGzUYJawpLasrYaXUzbBSjCDMfHj0/d2r3+nRSqCEXJClkML4/GfqkM9KibJJy /SXPofaatVn19dzwnjofERNaw6v7wDCG8h6byirRf3KbnjR9LkajGmWb+iVpHtdCKzJT ztrjop/1zaffX3FV2LEN3SGIRG1aW2GrjFjFnv7nKNMrSh9zLaETYN6O8IV7VOI7GWrF exRQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=L2TrOChC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63329-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63329-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCXLRzP/YVHsPpo12txnnGD29ZuPOw7KN9SrFawnFBM04RAQmYg4saPRafRc0dntyc8dqSnNhpuGxJ5fbmIzoMVrzjxt9BKql9IiWD1U4g== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id h22-20020a05620a13f600b00785d8a9889fsi3532073qkl.146.2024.02.13.02.17.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 02:17:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63329-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=L2TrOChC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63329-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63329-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 9ECD11C218B5 for ; Tue, 13 Feb 2024 10:17:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 909D922611; Tue, 13 Feb 2024 10:17:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="L2TrOChC" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C0651225CE for ; Tue, 13 Feb 2024 10:17:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707819457; cv=none; b=LACSxVaSDqkOl+4B8p4K8FTM+o74qaNoOuT7HLZ/EF1dC4op2ObNBMvtt9fhUJF0cWz4VSNCPZIXnxS8D/p9U/I7C/2B6B4sDtDisO/IYoYKUnL526zES2ud0Td5tRfshPR25CgEMTJRA206WIcabdkehCbbTWLRnVg/2RjyaUU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707819457; c=relaxed/simple; bh=SmIMSf7PRLHS1bKoo/5RP9uj4icwbgQjnEsI14pJqnA=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=EUSw30B0Z7QiF7Dh6EIhpg1PZ8S0Jl/LM/U0yKxAW8o63YRgi6XLer/EEF9x/XEtz+lKl4jWK4n/7aKDjFwTMuxvsRGEnbhpgkqNPdD1XabeoGia02IjpUL8v/0jjUTP30hz9TC0F2GEFcRNyEQnmnpAa9rXE4tYTWblt1STNv8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=L2TrOChC; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72D56C433C7; Tue, 13 Feb 2024 10:17:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707819457; bh=SmIMSf7PRLHS1bKoo/5RP9uj4icwbgQjnEsI14pJqnA=; h=From:To:Cc:Subject:Date:From; b=L2TrOChCRvMze16kk6fVZ/kj/Khuup7S7CcrYFegLwm5yHyYM3y5CiDvoDqNWoOOC wY4hOZYkHZbmfHqGYb+DCtqUdysls2exfIZ7mrWdDQhr/x0BMBEoifbmbcyO10qOnM WhGhGm2AYVkDdtzJKzyR428W2dgEidHKBGVl8ldqJZCgHdIttt5riZuJRfaXuSo9e/ RQXcmFi6An9gMxYKzZfkeswQ/X8fbMmvS3VEsgddnUc1PJA+d//SrU7F/NCbxxj6wE x6SkUiX8HeIgDn3LIe3lrgb1zEQv+3EQ8IFmjbs1mDcmKxG45WMAElz2ZLvhACIc/Q 32QJNhOa4ojUQ== From: Arnd Bergmann To: Jan Kara Cc: Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH] quota: avoid printing an uninitialized blk number Date: Tue, 13 Feb 2024 11:17:28 +0100 Message-Id: <20240213101733.461544-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Arnd Bergmann The error path of find_tree_dqentry() now prints a variable that is never initialized: fs/quota/quota_tree.c:674:8: error: variable 'blk' is uninitialized when used here [-Werror,-Wuninitialized] blk); ^~~ include/linux/quotaops.h:34:41: note: expanded from macro 'quota_error' __quota_error((sb), __func__, fmt , ## args) ^~~~ Move the calculation of the block number slightly up to make it show a sensible number. Fixes: 223bfb57631b ("quota: Detect loops in quota tree") Signed-off-by: Arnd Bergmann --- fs/quota/quota_tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/quota/quota_tree.c b/fs/quota/quota_tree.c index afceef3ddfaa..05ae39f9b1ac 100644 --- a/fs/quota/quota_tree.c +++ b/fs/quota/quota_tree.c @@ -669,13 +669,13 @@ static loff_t find_tree_dqentry(struct qtree_mem_dqinfo *info, if (!buf) return -ENOMEM; ret = read_blk(info, blks[depth], buf); + blk = le32_to_cpu(ref[get_index(info, dquot->dq_id, depth)]); if (ret < 0) { quota_error(dquot->dq_sb, "Can't read quota tree block %u", blks[depth]); goto out_buf; } ret = 0; - blk = le32_to_cpu(ref[get_index(info, dquot->dq_id, depth)]); if (!blk) /* No reference? */ goto out_buf; ret = do_check_range(dquot->dq_sb, "block", blk, QT_TREEOFF, -- 2.39.2