From nobody@FreeBSD.org  Sun Nov 27 16:51:26 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 17D6B1065672
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 27 Nov 2011 16:51:26 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 083138FC1E
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 27 Nov 2011 16:51:26 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id pARGpP0r046474
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 27 Nov 2011 16:51:25 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id pARGpOHJ046473;
	Sun, 27 Nov 2011 16:51:24 GMT
	(envelope-from nobody)
Message-Id: <201111271651.pARGpOHJ046473@red.freebsd.org>
Date: Sun, 27 Nov 2011 16:51:24 GMT
From: Robert Millan <rmh@debian.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: -E flag in newfs has no effect
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         162905
>Category:       bin
>Synopsis:       -E flag in newfs(8) has no effect
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov 27 17:00:21 UTC 2011
>Closed-Date:    
>Last-Modified:  Sun Nov 27 21:23:13 UTC 2011
>Originator:     Robert Millan
>Release:        FreeBSD 9-STABLE
>Organization:
>Environment:
>Description:

-E flag in newfs doesn't erase the whole device. For one thing, it returns immediately (which is unexpected since DIOCGDELETE ioctl is a blocking call). On the other hand, pre-existing filesystems continue to be usable:

# zpool create -m none -f test /dev/ada1s1
# zpool export test
# newfs -E /dev/ada1s1
[...]
Erasing sectors [128...16773119]
[...]
# zpool import test
#

>How-To-Repeat:

>Fix:
I don't know the fix, but it seems most likely a kernel bug (I've verified that DIOCGDELETE ioctl is indeed being called).


>Release-Note:
>Audit-Trail:
>Unformatted:
