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:
Zbigniew Jędrzejewski-Szmek
2015-11-03 00:02:00 +01:00
committed by Lennart Poettering
parent d8e023aa07
commit cfb571f30f
+1 -1
View File
@@ -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;
}