diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2016-02-23 12:11:15 +0100 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2016-02-23 12:22:18 +0100 |
commit | f501f083bf1ea9f60a8b18aa9b5d59f3459ee4a6 (patch) | |
tree | fe5aac14a94fc99c0d7a2aa4967df4caf4a2fffa | |
parent | 05eb87ca2defb6e7e7bd9759bab566de7cb6e3f0 (diff) | |
download | lvm2-f501f083bf1ea9f60a8b18aa9b5d59f3459ee4a6.tar.gz |
thin: fix read size compare
Fix the compare with 'unsigned' sizeof() and error read -1 result.
So the read error is correctly recognized.
-rw-r--r-- | WHATS_NEW | 1 | ||||
-rw-r--r-- | lib/activate/dev_manager.c | 2 |
2 files changed, 2 insertions, 1 deletions
@@ -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 diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c index 2826218e0..15d6bb93c 100644 --- a/lib/activate/dev_manager.c +++ b/lib/activate/dev_manager.c @@ -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]); |