]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: don't interpret regual XFS as external xfs log
authorKarel Zak <kzak@redhat.com>
Wed, 11 Sep 2013 13:33:26 +0000 (15:33 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 11 Sep 2013 13:33:26 +0000 (15:33 +0200)
 $ blkid -o udev -p tests/output/blkid/images-fs/xfs.img
 ID_FS_AMBIVALENT=filesystem:xfs other:xfs_external_log

it seems that regular XFS with internal log may be interpreted as log
device. This is incorrect.

This patch checks for XFS magic string to avoid this collision.

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

index 7c514e8ddc690386ca784bbf1e245655de68f99a..954289127df20469009b8d4e09093d47268738f3 100644 (file)
@@ -125,6 +125,9 @@ static int probe_xfs_log(blkid_probe pr, const struct blkid_idmag *mag)
        if (!buf)
                return -1;
 
+       if (memcmp(buf, "XFSB", 4) == 0)
+               return 1;                       /* this is regular XFS, ignore */
+
        /* check the first 512 512-byte sectors */
        for (i = 0; i < 512; i++) {
                rhead = (struct xlog_rec_header *)&buf[i*512];