Commit 8836f20c authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by Cyrill Gorcunov

util: Print message when read size is bad

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
parent 379dde63
......@@ -134,8 +134,10 @@ extern void printk(const char *format, ...);
#define read_safe_eof(fd, ptr, size, err) \
({ \
size_t rc__ = read(fd, ptr, (size)); \
if (rc__ && rc__ != (size)) \
if (rc__ && rc__ != (size)) { \
pr_err("img corruption %d/%d\n", rc__, (size));\
goto err; \
} \
rc__; \
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment