Bug#664088: mdadm fails to initialize components for bitmap

Wessel Dankers wsl-debian-bugs at fruit.je
Thu Mar 15 16:43:14 UTC 2012


Package: mdadm
Version: 3.2.3-2
Severity: normal

Hi,

When trying to add a bitmap to a freshly created device, I get an error:

# dd if=/dev/zero bs=1M count=100 of=/dev/vdb
# dd if=/dev/zero bs=1M count=100 of=/dev/vdc
# mdadm -C -l 1 -n 2 -e 1 --assume-clean /dev/md0 /dev/vdb /dev/vdc
mdadm: array /dev/md0 started.
# mdadm -G -b internal /dev/md0
mdadm: failed to set internal bitmap.

In dmesg I saw:

[10371.632948] md0: invalid bitmap file superblock: bad magic
[10371.632952] md0: bitmap file superblock:
[10371.632953]          magic: 00000000
[10371.632955]        version: 0
[10371.632957]           uuid: 00000000.00000000.00000000.00000000
[10371.632959]         events: 0
[10371.632960] events cleared: 0
[10371.632961]          state: 00000000
[10371.632963]      chunksize: 0 B
[10371.632964]   daemon sleep: 0s
[10371.632966]      sync size: 0 KB
[10371.632967] max write behind: 0

A strace of the mdadm -G command contained the following snippet:

open("/dev/vdb", O_RDWR|O_DIRECT)       = 4
fstat(4, {st_mode=S_IFBLK|S_ISVTX|0660, st_rdev=makedev(254, 16), ...}) = 0
ioctl(4, BLKGETSIZE64, 0x7fffc64838d0)  = 0
ioctl(4, BLKFLSBUF, 0)                  = 0
lseek(4, 4096, SEEK_SET)                = 4096
ioctl(4, BLKSSZGET, 0x7fffc64838cc)     = 0
read(4, "\374N+\251\1\0\0\0\0\0\0\0\0\0\0\0\371\323O\276]W~\353-2\27034U\246\216"..., 1024) = 1024
lseek(4, 8192, SEEK_SET)                = 8192
ioctl(4, BLKSSZGET, 0x7fffc648296c)     = 0
write(4, "bitm\4\0\0\0\371\323O\276]W~\353-2\27034U\246\216\0\0\0\0\0\0\0\0"..., 512) = -1 EINVAL (Invalid argument)
fsync(4)                                = 0
close(4)                                = 0

(Followed by a similar one for vdc.)

There are at least two bugs here:

1) mdadm opens the device with O_DIRECT but fails to do page aligned
   writes (a requirement for O_DIRECT).

2) mdadm does not check the return code of its write() calls.

Kind regards,

*** End of the template - remove these lines ***


-- Package-specific info:
--- mdadm.conf
CREATE owner=root group=disk mode=0660 auto=yes
HOMEHOST <system>
MAILADDR root
ARRAY /dev/md/0 metadata=1.2 UUID=c58e4d89:bf1aa69e:653e67e6:ee3e1114 name=marzipan:0

--- /etc/default/mdadm
INITRDSTART='none'
AUTOSTART=true
AUTOCHECK=false
START_DAEMON=false
DAEMON_OPTIONS="--syslog"
VERBOSE=false

--- /proc/mdstat:
Personalities : [raid1] 
md0 : active raid1 vdc[1] vdb[0]
      83884984 blocks super 1.2 [2/2] [UU]
      
unused devices: <none>

--- /proc/partitions:
major minor  #blocks  name

 254        0   16777216 vda
 254        1       2028 vda1
 254        2   16775149 vda2
  11        0     221184 sr0
 254       16   83886080 vdb
 254       32   83886080 vdc
 253        0    1048576 dm-0
 253        1    2088960 dm-1
 253        2    1048576 dm-2
 253        3    1048576 dm-3
 253        4    1048576 dm-4
 253        5    1048576 dm-5
 253        6    1048576 dm-6
   9        0   83884984 md0

--- LVM physical volumes:
  PV         VG   Fmt  Attr PSize  PFree
  /dev/vda2  raid lvm2 a--  15.99g 8.00g
--- mount output
udev on /dev type devtmpfs (rw,relatime,size=506600k,nr_inodes=126650,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=102712k,mode=755)
/dev/mapper/raid-root on / type xfs (rw,noatime,attr2,delaylog,logbufs=8,usrquota,grpquota)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,relatime,size=205420k)
/dev/mapper/raid-var on /var type xfs (rw,noatime,attr2,delaylog,logbufs=8,logbsize=256k,usrquota,grpquota)
/dev/mapper/raid-log on /var/log type xfs (rw,noatime,attr2,delaylog,logbufs=8,logbsize=256k,usrquota,grpquota)
/dev/mapper/raid-tmp on /tmp type xfs (rw,noatime,attr2,delaylog,logbufs=8,logbsize=256k,usrquota,grpquota)
/dev/mapper/raid-opt on /opt type xfs (rw,noatime,attr2,delaylog,logbufs=8,logbsize=256k,usrquota,grpquota)
/dev/mapper/raid-home on /home type xfs (rw,noatime,attr2,delaylog,logbufs=8,logbsize=256k,usrquota,grpquota)

--- initrd.img-3.2.0-2-amd64:
68778 blocks
8f2b1943789b8afb2a4fe9bac4c8635c  ./etc/mdadm/mdadm.conf
3b031fcad288668064811bd21f68d325  ./lib/modules/3.2.0-2-amd64/kernel/drivers/md/dm-mod.ko
9d5559edb35f648e9b2b035c15aa23ab  ./lib/modules/3.2.0-2-amd64/kernel/drivers/md/dm-snapshot.ko
be97804ec2556707a3341dba78fb1d7d  ./lib/modules/3.2.0-2-amd64/kernel/drivers/md/dm-log.ko
506110ecbebbbcf71609a34ce4ff4ee1  ./lib/modules/3.2.0-2-amd64/kernel/drivers/md/dm-region-hash.ko
592f84ebb28037a38bf53df931ad156c  ./lib/modules/3.2.0-2-amd64/kernel/drivers/md/dm-mirror.ko
3bbfdddaf535aa4cfe7bde3ad1797d75  ./lib/modules/3.2.0-2-amd64/kernel/drivers/md/md-mod.ko
f36d177658acfd40dea77a9a02ad4c8c  ./lib/modules/3.2.0-2-amd64/kernel/drivers/md/linear.ko
3f359aa2181df33dfe81ff8e5c611604  ./lib/modules/3.2.0-2-amd64/kernel/drivers/md/multipath.ko
8059e838a9fea6640247a43ff8bfbecb  ./lib/modules/3.2.0-2-amd64/kernel/drivers/md/raid0.ko
943a619864d95635cb835e36e367e95d  ./lib/modules/3.2.0-2-amd64/kernel/drivers/md/raid1.ko
4b91d231526258f7d7fcef0d676fb1d7  ./lib/modules/3.2.0-2-amd64/kernel/drivers/md/raid456.ko
f69e5ba35ab718c96270cec273ef9403  ./lib/modules/3.2.0-2-amd64/kernel/drivers/md/raid10.ko
c3beb0a215e8c507f1b43de188c67b21  ./sbin/mdadm
f4fbd9099399ab08ba9b9f6c71d77595  ./scripts/local-top/mdadm

--- initrd's /conf/conf.d/md:
MD_HOMEHOST='marzipan'
MD_DEVS=none
MD_MODULES=''

--- /proc/modules:
raid1 30714 1 - Live 0xffffffffa02c1000
md_mod 87742 1 raid1, Live 0xffffffffa0259000
dm_mod 63545 21 - Live 0xffffffffa0104000

--- /var/log/syslog:

--- volume detail:
/dev/vda:
   MBR Magic : aa55
Partition[0] :     33554431 sectors at            1 (type ee)
--
/dev/vda1 is not recognised by mdadm.
/dev/vda2 is not recognised by mdadm.
/dev/vdb:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x0
     Array UUID : f9d34fbe:5d577eeb:2d32b833:3455a68e
           Name : marzipan:0  (local to host marzipan)
  Creation Time : Thu Mar 15 17:21:05 2012
     Raid Level : raid1
   Raid Devices : 2

 Avail Dev Size : 167770112 (80.00 GiB 85.90 GB)
     Array Size : 167769968 (80.00 GiB 85.90 GB)
  Used Dev Size : 167769968 (80.00 GiB 85.90 GB)
    Data Offset : 2048 sectors
   Super Offset : 8 sectors
          State : clean
    Device UUID : 940a3d14:1d5717ad:572f151e:c670acfe

    Update Time : Thu Mar 15 17:29:48 2012
       Checksum : 8e482dc3 - correct
         Events : 2


   Device Role : Active device 0
   Array State : AA ('A' == active, '.' == missing)
--
/dev/vdc:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x0
     Array UUID : f9d34fbe:5d577eeb:2d32b833:3455a68e
           Name : marzipan:0  (local to host marzipan)
  Creation Time : Thu Mar 15 17:21:05 2012
     Raid Level : raid1
   Raid Devices : 2

 Avail Dev Size : 167770112 (80.00 GiB 85.90 GB)
     Array Size : 167769968 (80.00 GiB 85.90 GB)
  Used Dev Size : 167769968 (80.00 GiB 85.90 GB)
    Data Offset : 2048 sectors
   Super Offset : 8 sectors
          State : clean
    Device UUID : b07fb8dd:a32b652e:403967e7:638a41fd

    Update Time : Thu Mar 15 17:29:48 2012
       Checksum : a0f89aed - correct
         Events : 2


   Device Role : Active device 1
   Array State : AA ('A' == active, '.' == missing)
--

--- /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-3.2.0-2-amd64 root=/dev/mapper/raid-root ro rw quiet rootflags=logbufs=8,noatime,usrquota,grpquota elevator=noop

--- grub2:
	set root='(raid-root)'
	linux	/boot/vmlinuz-3.2.0-2-amd64 root=/dev/mapper/raid-root ro rw quiet rootflags=logbufs=8,noatime,usrquota,grpquota elevator=noop
	set root='(raid-root)'
	linux	/boot/vmlinuz-3.2.0-2-amd64 root=/dev/mapper/raid-root ro single rw
	set root='(raid-root)'
	set root='(raid-root)'
	set root='(raid-root)'
	set root='(raid-root)'

--- udev:
ii  udev           175-3.1        /dev/ and hotplug management daemon
6df86db16655769fa94086d3ee13453a  /lib/udev/rules.d/64-md-raid.rules

--- /dev:
brw-rw---T 1 root disk 9, 0 Mar 15 17:24 /dev/md0

/dev/disk/by-id:
total 0
lrwxrwxrwx 1 root root  9 Mar 15 14:29 ata-QEMU_DVD-ROM_QM00003 -> ../../sr0
lrwxrwxrwx 1 root root 10 Mar 15 14:29 dm-name-raid-home -> ../../dm-6
lrwxrwxrwx 1 root root 10 Mar 15 14:29 dm-name-raid-log -> ../../dm-3
lrwxrwxrwx 1 root root 10 Mar 15 14:29 dm-name-raid-opt -> ../../dm-5
lrwxrwxrwx 1 root root 10 Mar 15 14:29 dm-name-raid-root -> ../../dm-0
lrwxrwxrwx 1 root root 10 Mar 15 14:29 dm-name-raid-swap -> ../../dm-1
lrwxrwxrwx 1 root root 10 Mar 15 14:29 dm-name-raid-tmp -> ../../dm-4
lrwxrwxrwx 1 root root 10 Mar 15 14:29 dm-name-raid-var -> ../../dm-2
lrwxrwxrwx 1 root root 10 Mar 15 14:29 dm-uuid-LVM-djlfQvVjdBBSQXx22Ph1ifsKOdg2UFpM0aro7f7tv5AXAbPhPXNdGcJaeG4NDYqk -> ../../dm-3
lrwxrwxrwx 1 root root 10 Mar 15 14:29 dm-uuid-LVM-djlfQvVjdBBSQXx22Ph1ifsKOdg2UFpM5dGUKZE8acycj2AicBbs182PcSjcsh3r -> ../../dm-6
lrwxrwxrwx 1 root root 10 Mar 15 14:29 dm-uuid-LVM-djlfQvVjdBBSQXx22Ph1ifsKOdg2UFpMOUdK9Ne5cGhjvffR9VFcDycOx02vTbVr -> ../../dm-4
lrwxrwxrwx 1 root root 10 Mar 15 14:29 dm-uuid-LVM-djlfQvVjdBBSQXx22Ph1ifsKOdg2UFpMOcotnFa8P8QhFdcrleNyt91e7emLLGbv -> ../../dm-1
lrwxrwxrwx 1 root root 10 Mar 15 14:29 dm-uuid-LVM-djlfQvVjdBBSQXx22Ph1ifsKOdg2UFpMeIZeWPOhCmOoBQAhfhJWfecLruvKTZ2H -> ../../dm-0
lrwxrwxrwx 1 root root 10 Mar 15 14:29 dm-uuid-LVM-djlfQvVjdBBSQXx22Ph1ifsKOdg2UFpMvsb0T7swgs8ebHvm9t8OpaAzaVjMfmsj -> ../../dm-2
lrwxrwxrwx 1 root root 10 Mar 15 14:29 dm-uuid-LVM-djlfQvVjdBBSQXx22Ph1ifsKOdg2UFpMz5pMR9MJiaZsjZIzDGPsVekkWo9z8ZEy -> ../../dm-5
lrwxrwxrwx 1 root root  9 Mar 15 17:24 md-name-marzipan:0 -> ../../md0
lrwxrwxrwx 1 root root  9 Mar 15 17:24 md-uuid-f9d34fbe:5d577eeb:2d32b833:3455a68e -> ../../md0

/dev/disk/by-label:
total 0
lrwxrwxrwx 1 root root 10 Mar 15 14:29 home -> ../../dm-6
lrwxrwxrwx 1 root root 10 Mar 15 14:29 log -> ../../dm-3
lrwxrwxrwx 1 root root 10 Mar 15 14:29 opt -> ../../dm-5
lrwxrwxrwx 1 root root 10 Mar 15 14:29 root -> ../../dm-0
lrwxrwxrwx 1 root root 10 Mar 15 14:29 swap -> ../../dm-1
lrwxrwxrwx 1 root root 10 Mar 15 14:29 tmp -> ../../dm-4
lrwxrwxrwx 1 root root 10 Mar 15 14:29 var -> ../../dm-2

/dev/disk/by-path:
total 0
lrwxrwxrwx 1 root root  9 Mar 15 14:29 pci-0000:00:01.1-scsi-1:0:0:0 -> ../../sr0
lrwxrwxrwx 1 root root  9 Mar 15 14:29 pci-0000:00:05.0-virtio-pci-virtio2 -> ../../vda
lrwxrwxrwx 1 root root 10 Mar 15 14:29 pci-0000:00:05.0-virtio-pci-virtio2-part1 -> ../../vda1
lrwxrwxrwx 1 root root 10 Mar 15 14:29 pci-0000:00:05.0-virtio-pci-virtio2-part2 -> ../../vda2
lrwxrwxrwx 1 root root  9 Mar 15 17:24 pci-0000:00:06.0-virtio-pci-virtio3 -> ../../vdb
lrwxrwxrwx 1 root root  9 Mar 15 17:24 pci-0000:00:07.0-virtio-pci-virtio4 -> ../../vdc

/dev/disk/by-uuid:
total 0
lrwxrwxrwx 1 root root 10 Mar 15 14:29 4f33252b-31b7-4e80-81f3-7e0435335542 -> ../../dm-4
lrwxrwxrwx 1 root root 10 Mar 15 14:29 6511348f-a8ca-46ae-9fd9-afe9139e910d -> ../../dm-2
lrwxrwxrwx 1 root root 10 Mar 15 14:29 8b2edeaa-e271-49b6-9e9d-d5cb61bf2c15 -> ../../dm-3
lrwxrwxrwx 1 root root 10 Mar 15 14:29 c5d7ccce-e0a1-437b-b53b-dc7497ab0cee -> ../../dm-0
lrwxrwxrwx 1 root root 10 Mar 15 14:29 c99dc39b-6800-4b71-8678-b28ac6f515e6 -> ../../dm-5
lrwxrwxrwx 1 root root 10 Mar 15 14:29 d71a09ba-15de-4b74-8e1b-474baef62822 -> ../../dm-6
lrwxrwxrwx 1 root root 10 Mar 15 14:29 fdbdab5f-d446-4990-9268-2e7ce6f18337 -> ../../dm-1

/dev/md:
total 0

Auto-generated on Thu, 15 Mar 2012 17:32:20 +0100
by mdadm bugscript 3.2.3-2

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (400, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-2-amd64 (SMP w/1 CPU core)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash

Versions of packages mdadm depends on:
ii  debconf      1.5.41
ii  initscripts  2.88dsf-22
ii  libc6        2.13-27
ii  lsb-base     3.2-28.1
ii  makedev      2.3.1-89
ii  udev         175-3.1

Versions of packages mdadm recommends:
ii  module-init-tools               3.16-1
ii  postfix [mail-transport-agent]  2.8.7-1

mdadm suggests no packages.

-- debconf information excluded





More information about the pkg-mdadm-devel mailing list