Fix debug message when zeroing rest of data device.

The debug message printed wrong expected value and
also remained silent if expected value differed from
real bytes written to the data device.
This commit is contained in:
Ondrej Kozina
2019-01-31 16:23:09 +01:00
committed by Milan Broz
parent e9dcf6b8dd
commit faa07b71f9

View File

@@ -1054,9 +1054,9 @@ static void zero_rest_of_device(int fd, size_t block_size, void *buf,
s1 = *bytes; s1 = *bytes;
s2 = write(fd, buf, s1); s2 = write(fd, buf, s1);
if (s2 < 0) { if (s2 != s1) {
log_dbg("Write error, expecting %zu, got %zd.", log_dbg("Write error, expecting %zd, got %zd.",
block_size, s2); s1, s2);
return; return;
} }