Skip to content

Commit 51e14e7

Browse files
Thadeu Lima de Souza Cascardotytso
authored andcommitted
ext4: explicitly exit when ext4_find_inline_entry returns an error
__ext4_find_entry currently ignores the return of ext4_find_inline_entry, except for returning the bh or NULL when has_inline_data is 1. Even though has_inline_data is set to 1 before calling ext4_find_inline_entry and would only be set to 0 when that function returns NULL, check for an encoded error return explicitly in order to exit. That makes the code more readable, not requiring that one assumes the cases when has_inline_data is 1. Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@igalia.com> Link: https://patch.msgid.link/20240821152324.3621860-4-cascardo@igalia.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent 4d231b9 commit 51e14e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ext4/namei.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1574,7 +1574,7 @@ static struct buffer_head *__ext4_find_entry(struct inode *dir,
15741574
&has_inline_data);
15751575
if (inlined)
15761576
*inlined = has_inline_data;
1577-
if (has_inline_data)
1577+
if (has_inline_data || IS_ERR(ret))
15781578
goto cleanup_and_exit;
15791579
}
15801580

0 commit comments

Comments
 (0)