journal: return better error for empty files
When reading stuff, we should only return EIO when an actual read error occured, not when we don't like the data for whatever reason. We already return ENODATA for all other kinds of file truncation, hence do the same for the most obvious kind, so that callers know what ENODATA means.
This commit is contained in:
committed by
Lennart Poettering
parent
d8e023aa07
commit
cfb571f30f
@@ -2705,7 +2705,7 @@ int journal_file_open(
|
||||
}
|
||||
|
||||
if (f->last_stat.st_size < (off_t) HEADER_SIZE_MIN) {
|
||||
r = -EIO;
|
||||
r = -ENODATA;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user