1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

thin: fix read size compare

Fix the compare with 'unsigned' sizeof() and error read -1 result.
So the read error is correctly recognized.
This commit is contained in:
Zdenek Kabelac 2016-02-23 12:11:15 +01:00
parent 05eb87ca2d
commit f501f083bf
2 changed files with 2 additions and 1 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.144 -
=====================================
Fir read error detection when checking for uninitialized thin-pool header.
Fix error path for internal error in lvmetad vg lookup code.
Version 2.02.143 - 21st February 2016

View File

@ -1841,7 +1841,7 @@ static int _pool_callback(struct dm_tree_node *node,
return 0;
}
/* let's assume there is no problem to read 64 bytes */
if (read(fd, buf, sizeof(buf)) < sizeof(buf)) {
if (read(fd, buf, sizeof(buf)) < (int)sizeof(buf)) {
log_sys_error("read", argv[args]);
if (close(fd))
log_sys_error("close", argv[args]);