xfs
[Top] [All Lists]

interesting MD-xfs bug

To: xfs <xfs@xxxxxxxxxxx>, linux-raid <linux-raid@xxxxxxxxxxxxxxx>
Subject: interesting MD-xfs bug
From: Joe Landman <joe.landman@xxxxxxxxx>
Date: Thu, 09 Apr 2015 17:02:33 -0400
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=pFnw0duUruWY5+GDcB/gm0EmVHb6gGTE/CK1mjAGAlA=; b=GjRg2D+kJhdjqencMI5/33kvMXrCrhCL7wnWAyhyg54+p/8d07ID0eDYMbPuEdOnFN PJL0USxLMAUSKLA89tNjlyiulT8LFXgIPx2qr9WJ+Nc7y2cIeuaxHEzR3354E50IYj4r ecbe1X9E7t2CbvR8Gk7sIaoiouvDU8rub0NJwfyk/1JPWGhVyFhRaznCMJO/Ts7D15cP Dr9qV20Xd5d2uT7D4dIdg75m2y+5pylGpM1z+X8c8ntiYWkvmAxic+XsH0imVNG15Zf9 IOJLbTP9P8lv3QaJ2+gI/HHuRe3kv5+sArIXFY55b0sr1XOqAVnJeLNUVlr5rYZ2Oihh nMxA==
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0
If I build an MD raid0 with a non power of 2 chunk size, it appears that I can mkfs.xfs a file system, but it doesn't show up in blkid and is not mountable. Yet, using a power of 2 chunk size, this does work correctly. This is kernel 3.18.9.


For example, non-power of 2 chunk:

root@unison:~# wipefs -a /dev/sdb
4 bytes were erased at offset 0x1000 (linux_raid_member)
they were: fc 4e 2b a9
root@unison:~# wipefs -a /dev/sda
4 bytes were erased at offset 0x1000 (linux_raid_member)
they were: fc 4e 2b a9
root@unison:~# mdadm --create /dev/md20 --level=0 --metadata=1.2 --chunk=1152 --auto=yes --raid-disks=2 /dev/sd[ab]
mdadm: array /dev/md20 started.

root@unison:~# mkfs.xfs /dev/md20
log stripe unit (1179648 bytes) is too large (maximum is 256KiB)
log stripe unit adjusted to 32KiB
meta-data=/dev/md20 isize=256 agcount=50, agsize=268435296 blks
         =                       sectsz=512   attr=2, projid32bit=0
data     =                       bsize=4096   blocks=13164865984, imaxpct=5
         =                       sunit=288    swidth=576 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =internal log           bsize=4096   blocks=521728, version=2
         =                       sectsz=512   sunit=8 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

root@unison:~# blkid | grep xfs
root@unison:~#


Same system, with power of 2 chunk size:

root@unison:~# mdadm -S /dev/md20
mdadm: stopped /dev/md20
root@unison:~# wipefs -a /dev/sda
4 bytes were erased at offset 0x1000 (linux_raid_member)
they were: fc 4e 2b a9
root@unison:~# wipefs -a /dev/sdb
4 bytes were erased at offset 0x1000 (linux_raid_member)
they were: fc 4e 2b a9
root@unison:~# mdadm --create /dev/md20 --level=0 --metadata=1.2 --chunk=1024 --auto=yes --raid-disks=2 /dev/sd[ab]
mdadm: array /dev/md20 started.
root@unison:~# mkfs.xfs /dev/md20
log stripe unit (1048576 bytes) is too large (maximum is 256KiB)
log stripe unit adjusted to 32KiB
meta-data=/dev/md20 isize=256 agcount=50, agsize=268435200 blks
         =                       sectsz=512   attr=2, projid32bit=0
data     =                       bsize=4096   blocks=13164866048, imaxpct=5
         =                       sunit=256    swidth=512 blks
naming   =version 2              bsize=4096   ascii-ci=0
log      =internal log           bsize=4096   blocks=521728, version=2
         =                       sectsz=512   sunit=8 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
root@unison:~# blkid | grep xfs
/dev/md20: UUID="5e965ae7-198e-4e58-8920-a65c4b6bbe60" TYPE="xfs"

I am not sure which code base might be at "fault" or even if there is a "fault" (beyond simply saying "don't do non-power-of-two chunks"). If its the latter, happy to work on a warning message patch for mdadm if needed. If it should work, then happy to poke around if someone can give me a pointer where something might be relevant.

<Prev in Thread] Current Thread [Next in Thread>