From: Karel Zak Date: Tue, 7 Sep 2010 09:30:50 +0000 (+0200) Subject: libblkid: don't ignore zero for SBMAGIC_OFFSET X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23489c26252f1c40407804e0cd4964835db18e8c;p=util-linux libblkid: don't ignore zero for SBMAGIC_OFFSET The side effect of this bug is that wipefs(8) does not report LUKS... Signed-off-by: Karel Zak --- diff --git a/shlibs/blkid/src/superblocks/superblocks.c b/shlibs/blkid/src/superblocks/superblocks.c index 3d66d98c..95c10d6e 100644 --- a/shlibs/blkid/src/superblocks/superblocks.c +++ b/shlibs/blkid/src/superblocks/superblocks.c @@ -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); }