Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1184594pxb; Sun, 21 Feb 2021 15:16:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJyrYiyqxk9Z0AolkDjY4cBGMY9DZH8edkDnlALFFmAajpsEYfcGtyW0G5EJ+I3rjoUtkVhM X-Received: by 2002:a17:906:c30e:: with SMTP id s14mr3222655ejz.253.1613949386386; Sun, 21 Feb 2021 15:16:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613949386; cv=none; d=google.com; s=arc-20160816; b=rLJlT3oQuNw43osxMDv7HDKQNg08YkxWSzB5VJi5UM7NKTk+J125j6On827vYFjQ/v UBjQD9C9PjgR10TPw49OwxbYxYhxg378DWieGhPQbPd/WyhGAc0Atc/IZCA+gqEjjZNq EWg1V8Lr44/3H1mKvRmYmcJNegNckBDgPuO3k1FLfmS0AKFUlT6SNTgj7iXZzb/ob5IJ XgVFAPU3RLJxyK4tNXTleuLwgBfh280rW3FB/uzpWI7+9LYLq4QXv0VRXGJjeFsTFdD1 DdXI87yQWfhRMRX+nEw5K3nwFcYxz0O3JLtN7JUUe4dQJdkCI1P0Yl11i+qFiVu0WYil 1sHQ== 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; bh=sXRgQlCJny8tvFS464qj68dGSU7AUPSVGGd3+FsapWM=; b=QLQ76T6x1YLxGK2X22y13yLxzxj4+Xl6uynbTHIYkElh0VRtv1jKdDyKg9fQf4kfCg ErcdNCh6vgTqNkDd0X2qZSoj1WbH5m74USUFm8J3qra2VyQzvElTY+jpSgaF8B+6Fy0l cGOl1uaT4DDoot496tvScHikGoE53057xD+4URRlYn7KJrGtxIbgOvUXWHVr5Vt3rrqT JfmAd95YyYxidpd8OM6K9Pf8YrqByI6AL4s+RGgyY6mMD59WfmXIuL/eKVz1rIqq7SNB Wsh25q67BQ5OCv8HOfSKC372BRMnXIDCy3cf0kiiUBXBIciXcsxj043dsJNmzNq0iCIp QjKA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j23si11182484eje.581.2021.02.21.15.15.55; Sun, 21 Feb 2021 15:16:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232985AbhBUXO5 (ORCPT + 99 others); Sun, 21 Feb 2021 18:14:57 -0500 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:52465 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232988AbhBUXO4 (ORCPT ); Sun, 21 Feb 2021 18:14:56 -0500 Received: from cwcc.thunk.org (pool-72-74-133-215.bstnma.fios.verizon.net [72.74.133.215]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 11LNE6Ri027353 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 21 Feb 2021 18:14:07 -0500 Received: by cwcc.thunk.org (Postfix, from userid 15806) id 6F0DD15C342C; Sun, 21 Feb 2021 18:14:06 -0500 (EST) Date: Sun, 21 Feb 2021 18:14:06 -0500 From: "Theodore Ts'o" To: Harshad Shirwadkar Cc: linux-ext4@vger.kernel.org Subject: Re: [PATCH 4/4] e2fsck: initialize variable before first use in fast commit replay Message-ID: References: <20210219210333.1439525-1-harshads@google.com> <20210219210333.1439525-4-harshads@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210219210333.1439525-4-harshads@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, Feb 19, 2021 at 01:03:33PM -0800, Harshad Shirwadkar wrote: > From: Harshad Shirwadkar > > Initialize ext2fs_ex variable in ext4_fc_replay_scan() before first > use. > > Signed-off-by: Harshad Shirwadkar I wonder if we should make the following change to ext2fs_decode_extent(), which will prevent other future bugs to potential users of the function: to->e_pblk = ext2fs_le32_to_cpu(from->ee_start) + ((__u64) ext2fs_le16_to_cpu(from->ee_start_hi) << 32); to->e_lblk = ext2fs_le32_to_cpu(from->ee_block); to->e_len = ext2fs_le16_to_cpu(from->ee_len); - to->e_flags |= EXT2_EXTENT_FLAGS_LEAF; + to->e_flags = EXT2_EXTENT_FLAGS_LEAF; ext2fs_decode_extent() overwrites all other members of the structure, so we might as well just initialize e_flags as opposed to depending the caller to initiaize *to just for the sake of to->e_flags. Cheers, - Ted