From a92dcf5a6cc49660d75a67966b0eb093b88e3b4c Mon Sep 17 00:00:00 2001 From: "Tinguely, Mark" Date: Wed, 9 May 2018 16:50:25 +0200 Subject: Aadd HPE XFS support HPE XFS has a different superblock magic and type name to allow the community XFS and HPE XFS to coexist in the same linux kernel. This patch add HPE XFS support to the quota-tools so our customers can use it. Signed-off-by: Mark Tinguely Signed-off-by: Jan Kara --- bylabel.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bylabel.c') diff --git a/bylabel.c b/bylabel.c index ff10422..5313461 100644 --- a/bylabel.c +++ b/bylabel.c @@ -48,6 +48,7 @@ struct ext2_super_block { #define XFS_SUPER_MAGIC "XFSB" #define XFS_SUPER_MAGIC2 "BSFX" +#define EXFS_SUPER_MAGIC "EXFS" struct xfs_super_block { u_char s_magic[4]; u_char s_dummy[28]; @@ -107,7 +108,8 @@ static int get_label_uuid(const char *device, char **label, char *uuid) else if (lseek(fd, 0, SEEK_SET) == 0 && read(fd, (char *)&xfsb, sizeof(xfsb)) == sizeof(xfsb) && (strncmp((char *)&xfsb.s_magic, XFS_SUPER_MAGIC, 4) == 0 || - strncmp((char *)&xfsb.s_magic, XFS_SUPER_MAGIC2, 4) == 0)) { + strncmp((char *)&xfsb.s_magic, XFS_SUPER_MAGIC2, 4) == 0 || + strncmp((char *)&xfsb.s_magic, EXFS_SUPER_MAGIC, 4) == 0)) { memcpy(uuid, xfsb.s_uuid, sizeof(xfsb.s_uuid)); namesize = sizeof(xfsb.s_fsname); *label = smalloc(namesize + 1); -- cgit v1.2.3