From ed5a064d2ef8660c6cf329d9f57a39afc59ff675 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 11 Sep 2013 15:33:26 +0200 Subject: [PATCH] libblkid: don't interpret regual XFS as external xfs log $ 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 --- libblkid/src/superblocks/xfs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libblkid/src/superblocks/xfs.c b/libblkid/src/superblocks/xfs.c index 7c514e8ddc..954289127d 100644 --- a/libblkid/src/superblocks/xfs.c +++ b/libblkid/src/superblocks/xfs.c @@ -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]; -- 2.47.3