Bug#664088: mdadm fails to initialize components for bitmap
Michael Tokarev
mjt at tls.msk.ru
Sat Mar 17 11:53:15 UTC 2012
tags 664088 confirmed fixed-upstream
thanks
> 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:
> # mdadm -G -b internal /dev/md0
> mdadm: failed to set internal bitmap.
> 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.
This has been fixed upstream for the next version.
See:
https://bugzilla.redhat.com/show_bug.cgi?id=789898
http://neil.brown.name/git?p=mdadm;h=d669228f295e4c695475f0c1f7dc52f514a177c4
Apparently it only fixes the 1) case, not 2).
In any way, the fix will be in the next release.
Thanks,
/mjt
More information about the pkg-mdadm-devel
mailing list