Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Dec 2013 17:55:46 +0100
From:      Gyrd Thane Lange <gyrd-se@thanelange.no>
To:        Olivier =?UTF-8?B?Q29jaGFyZC1MYWJiw6k=?= <olivier@cochard.me>
Cc:        "freebsd-current@freebsd.org" <freebsd-current@freebsd.org>
Subject:   Re: Regression on -current with mdconfig or dd
Message-ID:  <20131208175546.2a7815ad@onyx.thanelange.no>
In-Reply-To: <CA%2Bq%2BTcr0DVRm%2BV81RutFg_UU5TQshUfgvNd%2B7=_0KKdDdNZxoQ@mail.gmail.com>
References:  <CA%2Bq%2BTcr0DVRm%2BV81RutFg_UU5TQshUfgvNd%2B7=_0KKdDdNZxoQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On Sun, 8 Dec 2013 15:50:55 +0100
Olivier Cochard-Labbé <olivier@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@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@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to
> "freebsd-current-unsubscribe@freebsd.org"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20131208175546.2a7815ad>