Skip to content

Commit 49688e6

Browse files
ultra-nexusstellarhopper
authored andcommitted
dax: Fix incorrect argument passed to xas_set_err()
The argument passed to xas_set_err() to indicate an error should be negative. Otherwise, xas_error() will return 0, and grab_mapping_entry() will return the found entry instead of 'SIGBUS' when the entry is not in fact valid. This would result in problems in subsequent code paths. Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Pankaj Gupta <[email protected]> Signed-off-by: Hao Li <[email protected]> Signed-off-by: Vishal Verma <[email protected]>
1 parent cbeb031 commit 49688e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/dax.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ static void *grab_mapping_entry(struct xa_state *xas,
488488
if (dax_is_conflict(entry))
489489
goto fallback;
490490
if (!xa_is_value(entry)) {
491-
xas_set_err(xas, EIO);
491+
xas_set_err(xas, -EIO);
492492
goto out_unlock;
493493
}
494494

0 commit comments

Comments
 (0)