]> err.no Git - util-linux/commitdiff
libblkid: don't ignore zero for SBMAGIC_OFFSET
authorKarel Zak <kzak@redhat.com>
Tue, 7 Sep 2010 09:30:50 +0000 (11:30 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 7 Sep 2010 09:30:50 +0000 (11:30 +0200)
The side effect of this bug is that wipefs(8) does not report LUKS...

Signed-off-by: Karel Zak <kzak@redhat.com>
shlibs/blkid/src/superblocks/superblocks.c

index 3d66d98c5f829fbd2c62b3e6c8ed680e42ddac8c..95c10d6eb8872c377bbc633be93fed5d5864ec8b 100644 (file)
@@ -487,10 +487,9 @@ int blkid_probe_set_magic(blkid_probe pr, blkid_loff_t offset,
        int rc = 0;
        struct blkid_chain *chn = blkid_probe_get_chain(pr);
 
-       if (chn->flags & BLKID_SUBLKS_MAGIC) {
-               if (magic && len)
-                       rc = blkid_probe_set_value(pr, "SBMAGIC", magic, len);
-               if (!rc && offset)
+       if (magic && len && (chn->flags & BLKID_SUBLKS_MAGIC)) {
+               rc = blkid_probe_set_value(pr, "SBMAGIC", magic, len);
+               if (!rc)
                        rc = blkid_probe_sprintf_value(pr, "SBMAGIC_OFFSET",
                                        "%llu", offset);
        }