]> err.no Git - util-linux/commitdiff
libblkid: cache is incorrectly revalidated
authorKarel Zak <kzak@redhat.com>
Tue, 23 Nov 2010 18:49:58 +0000 (19:49 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 23 Nov 2010 18:56:57 +0000 (19:56 +0100)
for example:

# echo "password" | cryptsetup luksFormat /dev/loop7
# blkid /dev/loop7
/dev/loop7: UUID="09240a80-1cf1-456d-9a6e-a35b39dc1f2b" TYPE="crypto_LUKS"

# pvcreate -ff /dev/loop7
# blkid /dev/loop7
#

the second blkid call has to return info about LVM.

Reported-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
shlibs/blkid/src/blkidP.h
shlibs/blkid/src/probe.c

index 6ac8910ccbcb093938eb8b1def3205d080e0a40d..956a84e2f3f2e9efdbc146379ae7be74690d1d87 100644 (file)
@@ -437,7 +437,7 @@ extern size_t blkid_rtrim_whitespace(unsigned char *str);
                ((bmp)[ blkid_bmp_idx_byte(item) ] |= blkid_bmp_idx_bit(item))
 
 #define blkid_bmp_unset_item(bmp, item)        \
-               ((bmp)[ bmp_idx_byte(item) ] &= ~bmp_idx_bit(item))
+               ((bmp)[ blkid_bmp_idx_byte(item) ] &= ~blkid_bmp_idx_bit(item))
 
 #define blkid_bmp_get_item(bmp, item)  \
                ((bmp)[ blkid_bmp_idx_byte(item) ] & blkid_bmp_idx_bit(item))
index 3698b99b3bfa5d6b4f0c2d27b64965b8f0f20c27..33e2fe13089a3c303f5e4f168fce128a6639e0c8 100644 (file)
@@ -431,14 +431,13 @@ int __blkid_probe_invert_filter(blkid_probe pr, int chain)
        struct blkid_chain *chn;
        unsigned long *fltr;
 
-       fltr = blkid_probe_get_filter(pr, chain, FALSE);
-       if (!fltr)
-               return -1;
-
        chn = &pr->chains[chain];
 
+       if (!chn->driver->has_fltr || !chn->fltr)
+               return -1;
+
        for (i = 0; i < blkid_bmp_nwords(chn->driver->nidinfos); i++)
-               fltr[i] = ~fltr[i];
+               chn->fltr[i] = ~chn->fltr[i];
 
        DBG(DEBUG_LOWPROBE, printf("probing filter inverted\n"));
        /* blkid_probe_dump_filter(pr, chain); */