From owner-freebsd-bugs@FreeBSD.ORG Sun Feb 5 17:20:07 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FE4E106566B for ; Sun, 5 Feb 2012 17:20:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 4F78A8FC14 for ; Sun, 5 Feb 2012 17:20:07 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q15HK7EH063909 for ; Sun, 5 Feb 2012 17:20:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q15HK74Z063908; Sun, 5 Feb 2012 17:20:07 GMT (envelope-from gnats) Resent-Date: Sun, 5 Feb 2012 17:20:07 GMT Resent-Message-Id: <201202051720.q15HK74Z063908@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, Daniel Hagerty Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1118E106564A for ; Sun, 5 Feb 2012 17:11:12 +0000 (UTC) (envelope-from hag@linnaean.org) Received: from perdition.linnaean.org (perdition.linnaean.org [IPv6:2001:470:8917:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id E0AD18FC0C for ; Sun, 5 Feb 2012 17:11:11 +0000 (UTC) Received: by perdition.linnaean.org (Postfix, from userid 31013) id 48AB61FA; Sun, 5 Feb 2012 12:11:11 -0500 (EST) Message-Id: <20120205171111.48AB61FA@perdition.linnaean.org> Date: Sun, 5 Feb 2012 12:11:11 -0500 (EST) From: Daniel Hagerty To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: bin/164802: Can't destroy zfs snapshots in 8-stable w/o -R X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Hagerty List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 17:20:07 -0000 >Number: 164802 >Category: bin >Synopsis: Can't destroy zfs snapshots in 8-stable w/o -R >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Feb 05 17:20:06 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Daniel Hagerty >Release: FreeBSD 8.2-STABLE amd64 >Organization: I'll let you know when I find some >Environment: System: FreeBSD perdition.linnaean.org 8.2-STABLE FreeBSD 8.2-STABLE #1 r230385+ec72e00: Fri Jan 27 18:41:46 EST 2012 root@perdition.linnaean.org:/usr/src/sys/amd64/compile/LINNAEAN64 amd64 8.2-STABLE, git id bc00e44d, svn r230835, some irrelevant local modifications. >Description: With my most recent update, I am unable to destroy zfs snapshots without using -R. This makes me unhappy, since -R is a big hammer. This is also affect automatic deletion of local snapshots provided by the sysutils/zfs-periodic port I'm using; it (quite sanely) doesn't use -R. >How-To-Repeat: $ zfs snapshot pool@snapshot $ zfs destroy -v pool@snapshot will destroy pool@snapshot will reclaim 0 [Exit 1 ] $ zfs list pool@snapshot NAME USED AVAIL REFER MOUNTPOINT pool@snapshot 0 - 35K - >Fix: Patch that fixes the issue below; it's based on the git id bc00e44d/svn r230835 that I'm currently running. The issue is the use of an uninitialized variable "err". commit 6233abc650e37b32f247f1e6690c9bc96395a6e8 Author: Daniel Hagerty Date: Sun Feb 5 11:33:26 2012 -0500 zfs destroy foo@bar fails due to uninitialized var diff --git a/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c b/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c index 78037d4..6bf3267 100644 --- a/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c +++ b/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c @@ -1206,7 +1206,7 @@ zfs_do_destroy(int argc, char **argv) at = strchr(argv[0], '@'); if (at != NULL) { - int err; + int err = 0; /* Build the list of snaps to destroy in cb_nvl. */ if (nvlist_alloc(&cb.cb_nvl, NV_UNIQUE_NAME, 0) != 0) >Release-Note: >Audit-Trail: >Unformatted: