From: Karel Zak Date: Wed, 11 Sep 2013 13:33:26 +0000 (+0200) Subject: libblkid: don't interpret regual XFS as external xfs log X-Git-Tag: v2.24-rc1~285 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed5a064d2ef8660c6cf329d9f57a39afc59ff675;p=thirdparty%2Futil-linux.git 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 --- 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];