Ubuntu-focal-kernel/fs/btrfs
David Sterba 298e6fe65e btrfs: initialize location to fix -Wmaybe-uninitialized in btrfs_lookup_dentry()
BugLink: https://bugs.launchpad.net/bugs/2081278

[ Upstream commit b8e947e9f64cac9df85a07672b658df5b2bcff07 ]

Some arch + compiler combinations report a potentially unused variable
location in btrfs_lookup_dentry(). This is a false alert as the variable
is passed by value and always valid or there's an error. The compilers
cannot probably reason about that although btrfs_inode_by_name() is in
the same file.

   >  + /kisskb/src/fs/btrfs/inode.c: error: 'location.objectid' may be used
   +uninitialized in this function [-Werror=maybe-uninitialized]:  => 5603:9
   >  + /kisskb/src/fs/btrfs/inode.c: error: 'location.type' may be used
   +uninitialized in this function [-Werror=maybe-uninitialized]:  => 5674:5

   m68k-gcc8/m68k-allmodconfig
   mips-gcc8/mips-allmodconfig
   powerpc-gcc5/powerpc-all{mod,yes}config
   powerpc-gcc5/ppc64_defconfig

Initialize it to zero, this should fix the warnings and won't change the
behaviour as btrfs_inode_by_name() accepts only a root or inode item
types, otherwise returns an error.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/linux-btrfs/bd4e9928-17b3-9257-8ba7-6b7f9bbb639a@linux-m68k.org/
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Koichiro Den <koichiro.den@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
2024-09-27 10:50:33 +02:00
..
tests btrfs: remove pointless and double ulist frees in error paths of qgroup tests 2023-02-01 15:21:05 +01:00
Kconfig
Makefile
acl.c
async-thread.c btrfs: fix memory ordering between normal and ordered work functions 2022-01-13 18:43:05 +01:00
async-thread.h
backref.c btrfs: fix information leak in btrfs_ioctl_logical_to_ino() 2024-06-07 15:01:46 +02:00
backref.h
block-group.c btrfs: reset block group chunk force if we have to wait 2022-10-17 15:01:25 +02:00
block-group.h
block-rsv.c btrfs: fix data race at btrfs_use_block_rsv() when accessing block reserve 2024-06-07 15:01:23 +02:00
block-rsv.h btrfs: fix data race at btrfs_use_block_rsv() when accessing block reserve 2024-06-07 15:01:23 +02:00
btrfs_inode.h btrfs: fix race between marking inode needs to be logged and log syncing 2021-10-01 11:31:09 +02:00
check-integrity.c
check-integrity.h
compression.c btrfs: mark compressed range uptodate only if all bio succeed 2021-09-20 18:49:47 +02:00
compression.h
ctree.c btrfs: fix extent buffer leak after tree mod log failure at split_node() 2023-10-30 11:41:44 +01:00
ctree.h btrfs: move btrfs_pinned_by_swapfile prototype into volumes.h 2023-10-30 11:42:23 +01:00
delalloc-space.c btrfs: don't arbitrarily slow down delalloc if we're committing 2024-02-02 14:13:10 +01:00
delalloc-space.h
delayed-inode.c btrfs: change BUG_ON to assertion when checking for delayed_node root 2024-09-27 10:50:24 +02:00
delayed-inode.h
delayed-ref.c
delayed-ref.h
dev-replace.c btrfs: dev-replace: properly validate device names 2024-04-26 10:54:11 +02:00
dev-replace.h
dir-item.c btrfs: unify lookup return value when dir entry is missing 2022-10-17 15:02:25 +02:00
disk-io.c btrfs: compare the correct fsid/metadata_uuid in btrfs_validate_super 2023-10-30 11:42:24 +01:00
disk-io.h
export.c btrfs: export: handle invalid inode or root reference in btrfs_get_parent() 2024-06-07 15:01:41 +02:00
export.h btrfs: fix type of parameter generation in btrfs_get_dentry 2023-01-06 08:44:44 -08:00
extent-tree.c btrfs: clean up our handling of refs == 0 in snapshot delete 2024-09-27 10:50:33 +02:00
extent_io.c btrfs: don't stop integrity writeback too early 2023-10-30 11:41:53 +01:00
extent_io.h btrfs: fix qgroup reserve overflow the qgroup limit 2022-05-20 15:20:02 +02:00
extent_map.c
extent_map.h
file-item.c btrfs: handle memory allocation failure in btrfs_csum_one_bio 2023-09-01 14:48:43 +02:00
file.c btrfs: fix race between marking inode needs to be logged and log syncing 2021-10-01 11:31:09 +02:00
free-space-cache.c btrfs: rename bitmap_set_bits() -> btrfs_bitmap_set_bits() 2024-09-27 10:50:22 +02:00
free-space-cache.h
free-space-tree.c
free-space-tree.h
inode-item.c
inode-map.c
inode-map.h
inode.c btrfs: initialize location to fix -Wmaybe-uninitialized in btrfs_lookup_dentry() 2024-09-27 10:50:33 +02:00
ioctl.c btrfs: allocate btrfs_ioctl_defrag_range_args on stack 2024-06-07 15:01:37 +02:00
locking.c
locking.h
lzo.c
misc.h
ordered-data.c
ordered-data.h
orphan.c
print-tree.c btrfs: print-tree: parent bytenr must be aligned to sector size 2023-08-09 12:25:25 +02:00
print-tree.h
props.c
props.h
qgroup.c btrfs: delete pointless BUG_ON check on quota root in btrfs_qgroup_account_extent() 2024-09-27 10:50:24 +02:00
qgroup.h btrfs: qgroup: catch reserved space leaks at unmount time 2023-10-30 11:41:44 +01:00
raid56.c btrfs: raid56: don't trust any cached sector in __raid56_parity_recover() 2022-10-17 15:02:06 +02:00
raid56.h
rcu-string.h btrfs: replace strncpy() with strscpy() 2023-02-01 15:23:34 +01:00
reada.c
ref-verify.c btrfs: ref-verify: free ref cache before clearing mount opt 2024-03-28 15:18:32 +01:00
ref-verify.h
relocation.c btrfs: unset reloc control if transaction commit fails in prepare_to_relocate() 2023-07-10 17:22:07 +02:00
root-tree.c btrfs: fix silent failure when deleting root reference 2022-10-17 15:02:16 +02:00
scrub.c btrfs: scrub: try to fix super block errors 2023-01-06 08:44:05 -08:00
send.c btrfs: send: handle unexpected data in header buffer in begin_cmd() 2024-09-27 10:50:24 +02:00
send.h
space-info.c btrfs: prevent __btrfs_dump_space_info() to underflow its free space 2021-11-05 09:12:41 +01:00
space-info.h
struct-funcs.c
super.c btrfs: properly report 0 avail for very full file systems 2024-01-05 14:29:50 +01:00
sysfs.c btrfs: sysfs: normalize the error handling branch in btrfs_init_sysfs() 2023-02-01 15:21:32 +01:00
sysfs.h
transaction.c btrfs: always clear PERTRANS metadata during commit 2024-07-05 10:51:52 +02:00
transaction.h btrfs: fix race between marking inode needs to be logged and log syncing 2021-10-01 11:31:09 +02:00
tree-checker.c btrfs: tree-checker: fix inline ref size in error messages 2024-03-28 15:18:32 +01:00
tree-checker.h
tree-defrag.c
tree-log.c btrfs: initialize start_slot in btrfs_log_prealloc_extents 2024-01-05 14:29:57 +01:00
tree-log.h btrfs: do not commit logs and transactions during link and rename operations 2021-09-20 18:49:53 +02:00
ulist.c
ulist.h
uuid-tree.c
volumes.c btrfs: add missing mutex_unlock in btrfs_relocate_sys_chunks() 2024-07-05 10:51:54 +02:00
volumes.h btrfs: add a helper to read the superblock metadata_uuid 2023-10-30 11:42:24 +01:00
xattr.c btrfs: check if root is readonly while setting security xattr 2022-10-17 15:02:17 +02:00
xattr.h
zlib.c btrfs: zlib: zero-initialize zlib workspace 2023-04-18 17:21:01 +02:00
zstd.c