Re: [PATCH] btrfs: fix uninitialized warning in btrfs_log_inode

From: David Sterba
Date: Mon May 22 2023 - 17:58:25 EST


On Tue, May 16, 2023 at 09:34:30AM +0800, zhangshida wrote:
> From: Shida Zhang <zhangshida@xxxxxxxxxx>
>
> From: Shida Zhang <zhangshida@xxxxxxxxxx>
>
> This fixes the following warning reported by gcc 10 under x86_64:
>
> ../fs/btrfs/tree-log.c: In function ‘btrfs_log_inode’:
> ../fs/btrfs/tree-log.c:6211:9: error: ‘last_range_start’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
> 6211 | ret = insert_dir_log_key(trans, log, path, key.objectid,
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 6212 | first_dir_index, last_dir_index);
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../fs/btrfs/tree-log.c:6161:6: note: ‘last_range_start’ was declared here
> 6161 | u64 last_range_start;
> | ^~~~~~~~~~~~~~~~
>
> Reported-by: k2ci <kernel-bot@xxxxxxxxxx>
> Signed-off-by: Shida Zhang <zhangshida@xxxxxxxxxx>

Added to misc-next, thanks.