lkml.org 
[lkml]   [2020]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.19 501/639] ext4: set error return correctly when ext4_htree_store_dirent fails
    Date
    From: Colin Ian King <colin.king@canonical.com>

    [ Upstream commit 7a14826ede1d714f0bb56de8167c0e519041eeda ]

    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: Sasha Levin <sashal@kernel.org>
    ---
    fs/ext4/inline.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
    index 56f6e1782d5f7..4572cb0579518 100644
    --- a/fs/ext4/inline.c
    +++ b/fs/ext4/inline.c
    @@ -1419,7 +1419,7 @@ int htree_inlinedir_to_tree(struct file *dir_file,
    err = ext4_htree_store_dirent(dir_file, hinfo->hash,
    hinfo->minor_hash, de, &tmp_str);
    if (err) {
    - count = err;
    + ret = err;
    goto out;
    }
    count++;
    --
    2.20.1


    \
     
     \ /
      Last update: 2020-01-24 12:39    [W:2.513 / U:0.764 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site