]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ext4: set error return correctly when ext4_htree_store_dirent fails
authorColin Ian King <colin.king@canonical.com>
Mon, 12 Aug 2019 18:29:38 +0000 (14:29 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 10 Dec 2019 18:01:12 +0000 (18:01 +0000)
commit 7a14826ede1d714f0bb56de8167c0e519041eeda upstream.

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: 8af0f0822797 ("ext4: fix readdir error in the case of inline_data+dir_index")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/ext4/inline.c

index c2bb71c98d43a518b27fbcae6f4f21ef6d674c53..7141a10004645ccd6e1a5bc8f3d58b3be13ac896 100644 (file)
@@ -1404,7 +1404,7 @@ int htree_inlinedir_to_tree(struct file *dir_file,
                err = ext4_htree_store_dirent(dir_file,
                                   hinfo->hash, hinfo->minor_hash, de);
                if (err) {
-                       count = err;
+                       ret = err;
                        goto out;
                }
                count++;