Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp4491133ybx; Mon, 4 Nov 2019 14:17:59 -0800 (PST) X-Google-Smtp-Source: APXvYqwbg8T4R4ARn/Mz8tsx3LX1VXWat0Y5Kv3ZHHIWkopPGWG6jaK0wxwiRajhamXVfa9D8S2k X-Received: by 2002:aa7:cd64:: with SMTP id ca4mr32101077edb.121.1572905879501; Mon, 04 Nov 2019 14:17:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572905879; cv=none; d=google.com; s=arc-20160816; b=kHRLGqhGflqgCxBmEf2BfKhlAZYsvWc3+O5ZnfinXhRRDRCOYTP1V8JiOTujF4Ewe3 1NyH6l6t6zF9cI8gJUhDyXsqOojWOi1FftDY2vwdBEIMpct5b7MRrgZuOUcHmWt/jUK2 Uv9TsxMHUSzJUdmLaVPTuR8t+zcQ1tL69RC8lBzZhrWpMjO6pfbeee0k6S53z8kmxtY/ 2qP4BP2r4sHLRfkIB9f0E6cQy61/mSlT4TfrDbXVVAJoow6BFbI35KKV18TPLqBO4Bal My+0b5C+htVO7ymx+NUBz3+iF6ti7fsLD5cwczN8qcmZa/0EUzYB3gNEenOkavBQ+82D xAOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WHRqnHsL85FKBuK/LZwO7fP+J9DtXrOG/ilIWxNe2Ro=; b=GoApLgR0LT6PsfpnUAmOzTPupJY59Gjmon6AtNW9F38VNtB6Z3sGstE74vRpPUwS/q QfBk5YWIdSL9IoPp6ql+RaoAEERkhhBLnYfJ0WvHBIUBSJCyxb36i8kQhjH6MtS86/HG gYwrWUoXEtEMjQvusUYn9QKf0zsA0MYKfz9twl16xfdZGfc4x3SSikyOsLXrXw9bgvWD pKvXDz7kcO+3qUR/Zrcm0MrYv0LDNdDGdhQ4K8npdrWXrCEchf0rH9a81b5r7Lq5absF A/hc2/I6+xTNTMTtbRnTZ8VC8h5rDSKhDu+rB4jCjE3biOtwxJrwD4zqA1JOnoUbXGwP 67vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HlDbbDwM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dd5si850760ejb.179.2019.11.04.14.17.36; Mon, 04 Nov 2019 14:17:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HlDbbDwM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388256AbfKDWGn (ORCPT + 99 others); Mon, 4 Nov 2019 17:06:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:38540 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389978AbfKDWGf (ORCPT ); Mon, 4 Nov 2019 17:06:35 -0500 Received: from localhost (6.204-14-84.ripe.coltfrance.com [84.14.204.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A21AB20650; Mon, 4 Nov 2019 22:06:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572905195; bh=M5sVEkLfwvxy3JlQ9ejc5M3w1uVEQ8hslW83InsFHO4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HlDbbDwMHeWoyKEuCiK1M9yExZXDO1pf2N/+Q1KtYDhdk6sU3dg9XOyCPdkaowF+i EsRvxFQ4U6Cjw6pZ7FKVCgqk0FtBo07XjDchS/TJz3r4upNP4jZIaApZKz0rnvdNgL kUxIeXaGbKKfb9f7/06o3pgZwvxfU+J/aC+Jee1s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Austin Kim , David Sterba , Sasha Levin Subject: [PATCH 5.3 062/163] btrfs: silence maybe-uninitialized warning in clone_range Date: Mon, 4 Nov 2019 22:44:12 +0100 Message-Id: <20191104212144.521512803@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191104212140.046021995@linuxfoundation.org> References: <20191104212140.046021995@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Austin Kim [ Upstream commit 431d39887d6273d6d84edf3c2eab09f4200e788a ] GCC throws warning message as below: ‘clone_src_i_size’ may be used uninitialized in this function [-Wmaybe-uninitialized] #define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0) ^ fs/btrfs/send.c:5088:6: note: ‘clone_src_i_size’ was declared here u64 clone_src_i_size; ^ The clone_src_i_size is only used as call-by-reference in a call to get_inode_info(). Silence the warning by initializing clone_src_i_size to 0. Note that the warning is a false positive and reported by older versions of GCC (eg. 7.x) but not eg 9.x. As there have been numerous people, the patch is applied. Setting clone_src_i_size to 0 does not otherwise make sense and would not do any action in case the code changes in the future. Signed-off-by: Austin Kim Reviewed-by: David Sterba [ add note ] Signed-off-by: David Sterba Signed-off-by: Sasha Levin --- fs/btrfs/send.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index c3c0c064c25da..91c702b4cae9d 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -5070,7 +5070,7 @@ static int clone_range(struct send_ctx *sctx, struct btrfs_path *path; struct btrfs_key key; int ret; - u64 clone_src_i_size; + u64 clone_src_i_size = 0; /* * Prevent cloning from a zero offset with a length matching the sector -- 2.20.1