Re: Regression on -current with mdconfig or dd

From: Gyrd Thane Lange <gyrd-se_at_thanelange.no>
Date: Sun, 8 Dec 2013 17:55:46 +0100
On Sun, 8 Dec 2013 15:50:55 +0100
Olivier Cochard-Labbé <olivier_at_cochard.me> wrote:

> Hi,
> 
> I found a regression on current:
> The problem is meet with dd but I'm not sure it's the root cause.
> 
> Here is how to reproduce the problem easily with 3 commands:
> 
> dd if=/dev/zero of=/tmp/SOURCE.img seek=100000 count=0
> mdconfig -a -t vnode -f /tmp/SOURCE.img
> dd conv=sparse if=/dev/md0 of=/tmp/DEST.img bs=64k
> 
> => This last "dd" works great on 10.0-BETA3 and older but failed on
> -current (r258675 and r259096) with the message:
> dd: /dev/md0s1: Input/output error

Hi, I can confirm this problem also exists on my 11-CURRENT (late
november).
It is not md-specific as I also see it with real disks:

This example is from a partition that is exactly 34 sectors large.
(512 sector size).

[root_at_onyx ~]# dd if=/dev/ada2p9 | hd
00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00
|................| *
dd: /dev/ada2p9: Input/output error
35+0 records in
35+0 records out
17920 bytes transferred in 0.269167 secs (66576 bytes/sec)
00004600

But still it tries to overshoot and read size+1 sectors. BTW I don't
know where it gets the data for the last sector since the partition
following this has non-zero data in its first sector but dd thinks it
got a zero filled sector.

On my other system, FreeBSD 8.3 the dd gets this right by copying
exactly 34 sectors (even if I try to specify count=35 or larger).

An even shorter method of reproducing is to create a 34 * 512 = 17408
byte memory backed device and read from it:

# mdconfig -a -t malloc -s 34 -u 1
# dd if=/dev/md1 of=/dev/null
dd: /dev/md1: Input/output error
35+0 records in
35+0 records out
17920 bytes transferred in 0.000354 secs (50614093 bytes/sec)

Try to write to it:
# dd if=/dev/zero of=/dev/md1
dd: /dev/md1: Input/output error
36+0 records in
35+0 records out
17920 bytes transferred in 0.000459 secs (39045157 bytes/sec)

Where does it write the data to? (Have not dared to try on a real disk
yet.)

Gyrd ^_^

> 
> Regards,
> 
> Olivier
> _______________________________________________
> freebsd-current_at_freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to
> "freebsd-current-unsubscribe_at_freebsd.org"
Received on Sun Dec 08 2013 - 15:55:55 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:45 UTC