Commit 2324dca1 authored by Colin Ian King's avatar Colin Ian King Committed by Kleber Sacilotto de Souza

ext4: set error return correctly when ext4_htree_store_dirent fails

BugLink: https://bugs.launchpad.net/bugs/1864773

[ Upstream commit 7a14826e ]

Currently when the call to ext4_htree_store_dirent fails the error return
variable 'ret' is is not being set to the error code and variable count is
instead, hence the error code is not being returned.  Fix this by assigning
ret to the error return code.

Addresses-Coverity: ("Unused value")
Fixes: 8af0f082 ("ext4: fix readdir error in the case of inline_data+dir_index")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 1c269c8a
...@@ -1418,7 +1418,7 @@ int htree_inlinedir_to_tree(struct file *dir_file, ...@@ -1418,7 +1418,7 @@ int htree_inlinedir_to_tree(struct file *dir_file,
err = ext4_htree_store_dirent(dir_file, hinfo->hash, err = ext4_htree_store_dirent(dir_file, hinfo->hash,
hinfo->minor_hash, de, &tmp_str); hinfo->minor_hash, de, &tmp_str);
if (err) { if (err) {
count = err; ret = err;
goto out; goto out;
} }
count++; count++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment