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=C3=A9 <olivier@cochard.me> wrote:

> Hi,
>=20
> I found a regression on current:
> The problem is meet with dd but I'm not sure it's the root cause.
>=20
> Here is how to reproduce the problem easily with 3 commands:
>=20
> dd if=3D/dev/zero of=3D/tmp/SOURCE.img seek=3D100000 count=3D0
> mdconfig -a -t vnode -f /tmp/SOURCE.img
> dd conv=3Dsparse if=3D/dev/md0 of=3D/tmp/DEST.img bs=3D64k
>=20
> =3D> 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=3D/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=3D35 or larger).

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

# mdconfig -a -t malloc -s 34 -u 1
# dd if=3D/dev/md1 of=3D/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=3D/dev/zero of=3D/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 ^_^

>=20
> Regards,
>=20
> 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>