]> sourceware.org Git - lvm2.git/commitdiff
thin: fix read size compare
authorZdenek Kabelac <zkabelac@redhat.com>
Tue, 23 Feb 2016 11:11:15 +0000 (12:11 +0100)
committerZdenek Kabelac <zkabelac@redhat.com>
Tue, 23 Feb 2016 11:22:18 +0000 (12:22 +0100)
Fix the compare with 'unsigned' sizeof() and error read -1 result.
So the read error is correctly recognized.

WHATS_NEW
lib/activate/dev_manager.c

index f15d8855f764629ca2057d9a6e34085be627af97..355712c6b1e58250e2185a1d1ca3c44b84f07bcb 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -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
index 2826218e03d4fc1065f88743d514fd80c40452fb..15d6bb93c4b0150496e47d4fdfbafcb6ff475cbc 100644 (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]);
This page took 2.405779 seconds and 5 git commands to generate.