]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ext4: bail out of ext4_xattr_ibody_get() fails for any reason
authorTheodore Ts'o <tytso@mit.edu>
Fri, 12 May 2023 19:16:27 +0000 (15:16 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 09:36:03 +0000 (11:36 +0200)
commit 2a534e1d0d1591e951f9ece2fb460b2ff92edabd upstream.

In ext4_update_inline_data(), if ext4_xattr_ibody_get() fails for any
reason, it's best if we just fail as opposed to stumbling on,
especially if the failure is EFSCORRUPTED.

Cc: stable@kernel.org
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/inline.c

index 9ad21c4dcb50003b3435f9a2bc26ca7134c7940d..549ceac9099ca4f3e62be9f59b4809d8bce9d10f 100644 (file)
@@ -358,7 +358,7 @@ static int ext4_update_inline_data(handle_t *handle, struct inode *inode,
 
        error = ext4_xattr_ibody_get(inode, i.name_index, i.name,
                                     value, len);
-       if (error == -ENODATA)
+       if (error < 0)
                goto out;
 
        BUFFER_TRACE(is.iloc.bh, "get_write_access");