mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
btrfs: fix compiler warning on SPARC/PA-RISC handling fscrypt_setup_filename
Commit 1ec49744ba
("btrfs: turn on -Wmaybe-uninitialized") exposed
that on SPARC and PA-RISC, gcc is unaware that fscrypt_setup_filename()
only returns negative error values or 0. This ultimately results in a
maybe-uninitialized warning in btrfs_lookup_dentry().
Change to only return negative error values or 0 from
fscrypt_setup_filename() at the relevant call site, and assert that no
positive error codes are returned (which would have wider implications
involving other users).
Reported-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/all/481b19b5-83a0-4793-b4fd-194ad7b978c3@roeck-us.net/
Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
1c3ab6dfa0
commit
10a8857a1b
1 changed files with 6 additions and 1 deletions
|
@ -5421,8 +5421,13 @@ static int btrfs_inode_by_name(struct btrfs_inode *dir, struct dentry *dentry,
|
|||
return -ENOMEM;
|
||||
|
||||
ret = fscrypt_setup_filename(&dir->vfs_inode, &dentry->d_name, 1, &fname);
|
||||
if (ret)
|
||||
if (ret < 0)
|
||||
goto out;
|
||||
/*
|
||||
* fscrypt_setup_filename() should never return a positive value, but
|
||||
* gcc on sparc/parisc thinks it can, so assert that doesn't happen.
|
||||
*/
|
||||
ASSERT(ret == 0);
|
||||
|
||||
/* This needs to handle no-key deletions later on */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue