mirror of
https://github.com/versity/scoutfs.git
synced 2026-01-05 03:44:05 +00:00
Prevent masking away inconsistent state in search_sorted_file.
In these two error conditions we explicitly set `ret = -EIO` but then `break` to set `ret = 0` immediately again, masking away a critical error code that should be returned. Instead, `goto out` retains the EIO error value for the caller. Signed-off-by: Auke Kok <auke.kok@versity.com>
This commit is contained in:
@@ -856,14 +856,14 @@ static int search_sorted_file(struct super_block *sb,
|
||||
if (pos > SCOUTFS_SRCH_BLOCK_SAFE_BYTES) {
|
||||
/* can only be inconsistency :/ */
|
||||
ret = -EIO;
|
||||
break;
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = decode_entry(srb->entries + pos, &sre, &prev);
|
||||
if (ret <= 0) {
|
||||
/* can only be inconsistency :/ */
|
||||
ret = -EIO;
|
||||
break;
|
||||
goto out;
|
||||
}
|
||||
pos += ret;
|
||||
prev = sre;
|
||||
|
||||
Reference in New Issue
Block a user