From owner-freebsd-bugs@FreeBSD.ORG Thu May 1 09:20:00 2014 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E9D2AD7A for ; Thu, 1 May 2014 09:20:00 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AFE0512F2 for ; Thu, 1 May 2014 09:20:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s419K05O053653 for ; Thu, 1 May 2014 09:20:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s419K0CJ053652; Thu, 1 May 2014 09:20:00 GMT (envelope-from gnats) Resent-Date: Thu, 1 May 2014 09:20:00 GMT Resent-Message-Id: <201405010920.s419K0CJ053652@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Thomas Quinot Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2FA70CED for ; Thu, 1 May 2014 09:14:46 +0000 (UTC) Received: from melamine.cuivre.fr.eu.org (houdart.cuivre.fr.eu.org [81.57.40.110]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E43AD12BD for ; Thu, 1 May 2014 09:14:45 +0000 (UTC) Received: by melamine.cuivre.fr.eu.org (Postfix, from userid 1000) id 11CCB110AC; Thu, 1 May 2014 11:06:29 +0200 (CEST) Message-Id: <20140501090629.11CCB110AC@melamine.cuivre.fr.eu.org> Date: Thu, 1 May 2014 11:06:28 +0200 (CEST) From: Thomas Quinot To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.114 Subject: bin/189174: dd conv=sparse bs=64k EINVAL on sparse last block X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Thomas Quinot List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2014 09:20:01 -0000 >Number: 189174 >Category: bin >Synopsis: dd conv=sparse bs=64k EINVAL on sparse last block >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu May 01 09:20:00 UTC 2014 >Closed-Date: >Last-Modified: >Originator: Thomas Quinot >Release: FreeBSD 9.2-STABLE amd64 >Organization: >Environment: System: FreeBSD melamine.cuivre.fr.eu.org 9.2-STABLE FreeBSD 9.2-STABLE #0 r256080: Sun Oct 6 15:33:30 CEST 2013 thomas@melamine.cuivre.fr.eu.org:/usr/obj/users/thomas/projects/FreeBSD/base/stable/9/sys/GENERIC amd64 >Description: When copying to an md device (or a slice thereof) with conv=sparse and an explicit block size, dd will produce an error if the last block is a sparse and partial one. (This breaks NanoBSD builds in the case where two system images are created, and the slice size computed from the media size is not an intregral multiple of 64k). This is with dd(1) from stable/9 as of rev 265172. >How-To-Repeat: # dd if=/dev/zero of=f1 count=129 129+0 records in 129+0 records out 66048 bytes transferred in 0.003451 secs (19139518 bytes/sec) # dd if=/dev/zero of=f2 count=129 129+0 records in 129+0 records out 66048 bytes transferred in 0.003485 secs (18952274 bytes/sec) # mdconfig -f f1 md0 # mdconfig -f f2 md1 # dd if=/dev/md0 of=/dev/md1 conv=sparse bs=64k dd: /dev/md1: Invalid argument 1+1 records in 1+0 records out 65536 bytes transferred in 0.000338 secs (193849018 bytes/sec) >Fix: >Release-Note: >Audit-Trail: >Unformatted: