From owner-freebsd-bugs@FreeBSD.ORG Tue Jun 14 07:30:12 2011 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 E972B106566C for ; Tue, 14 Jun 2011 07:30:12 +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 BD1DE8FC13 for ; Tue, 14 Jun 2011 07:30:12 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p5E7UC5q050838 for ; Tue, 14 Jun 2011 07:30:12 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p5E7UCxY050834; Tue, 14 Jun 2011 07:30:12 GMT (envelope-from gnats) Resent-Date: Tue, 14 Jun 2011 07:30:12 GMT Resent-Message-Id: <201106140730.p5E7UCxY050834@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, Garrett Wollman Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D87C1065672 for ; Tue, 14 Jun 2011 07:29:43 +0000 (UTC) (envelope-from wollman@hergotha.csail.mit.edu) Received: from hergotha.csail.mit.edu (wollman-1-pt.tunnel.tserv4.nyc4.ipv6.he.net [IPv6:2001:470:1f06:ccb::2]) by mx1.freebsd.org (Postfix) with ESMTP id 3E3D58FC15 for ; Tue, 14 Jun 2011 07:29:43 +0000 (UTC) Received: from hergotha.csail.mit.edu (localhost [127.0.0.1]) by hergotha.csail.mit.edu (8.14.4/8.14.4) with ESMTP id p5E7TgYu073912 for ; Tue, 14 Jun 2011 03:29:42 -0400 (EDT) (envelope-from wollman@hergotha.csail.mit.edu) Received: (from wollman@localhost) by hergotha.csail.mit.edu (8.14.4/8.14.4/Submit) id p5E7Tg5f073911; Tue, 14 Jun 2011 03:29:42 -0400 (EDT) (envelope-from wollman) Message-Id: <201106140729.p5E7Tg5f073911@hergotha.csail.mit.edu> Date: Tue, 14 Jun 2011 03:29:42 -0400 (EDT) From: Garrett Wollman To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: kern/157869: easy to create zvols that cannot be forgotten X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Garrett Wollman List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2011 07:30:13 -0000 >Number: 157869 >Category: kern >Synopsis: easy to create zvols that cannot be forgotten >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jun 14 07:30:12 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Garrett Wollman >Release: FreeBSD 8.2-RELEASE-p2 amd64 >Organization: self >Environment: System: FreeBSD hergotha.csail.mit.edu 8.2-RELEASE-p2 FreeBSD 8.2-RELEASE-p2 #2 r222519M: Wed Jun 1 01:40:10 EDT 2011 wollman@hergotha.csail.mit.edu:/usr/obj/usr/src/sys/HERGOTHA amd64 This machine is running a ZFS universe. >Description: It is possible to create ZFS zvols with names that are too long to be GEOM providers. In fact, if the zvol is labeled (e.g., because the zvol was used as a virtual drive on a virtual machine running FreeBSD), it will instantiate multiple GEOM providers with the same name which cannot be distinguished. Furthermore, it will be impossible to export the zpool where those zvols reside. This is accompanied by a message on the console: > WARNING: Device name truncated! (zvol/hergotha-tank-backup/vbox/devbox-9.0-current@backup-2011-0) "zpool export" emits error messages the first time around: > cannot open 'hergotha-tank-backup/vbox/devbox-9.0-currents1b': dataset does not exist > cannot open 'hergotha-tank-backup/vbox/devbox-9.0-currents1a': dataset does not exist > cannot open 'hergotha-tank-backup/vbox/devbox-9.0-currents1': dataset does not exist > cannot export 'hergotha-tank-backup': pool is busy At this point, devfs shows: root@hergotha$ ls -l /dev/zvol/hergotha-tank-backup/vbox/ total 0 crw-r----- 1 root operator 1, 22 Jun 14 02:31 devbox-9.0-current@backup-2011-0 crw-r----- 1 root operator 1, 22 Jun 14 02:31 devbox-9.0-current@backup-2011-0 crw-r----- 1 root operator 1, 22 Jun 14 02:31 devbox-9.0-current@backup-2011-0 crw-r----- 1 root operator 1, 22 Jun 14 02:31 devbox-9.0-current@backup-2011-0 crw-r----- 1 root operator 1, 22 Jun 14 02:31 devbox-9.0-current@backup-2011-0 crw-r----- 1 root operator 1, 22 Jun 14 02:31 devbox-9.0-current@backup-2011-0 crw-r----- 1 root operator 1, 22 Jun 14 02:31 devbox-9.0-current@backup-2011-0 crw-r----- 1 root operator 1, 22 Jun 14 02:31 devbox-9.0-current@backup-2011-0 "zpool export -f" pretends to succeed, but the pool is still listed as being online. After this point, the "cannot export" message goes away. Removing the drive causes ZFS to realize that the pool has gone offline. >How-To-Repeat: Create a zvol with a long name (see above), and label it by installing FreeBSD inside a virtual machine. >Fix: ZFS should choose one of the following behaviors: 1) Don't instantiate GEOM providers whose names would be truncated. 2) Keep track of the GEOM providers in some other way that allows them to be withered when the zpool is exported. GEOM should probably be fixed to either make that warning an error, or (preferably) lift the length limit to something a bit more reasonable for ZFS. -GAWollman >Release-Note: >Audit-Trail: >Unformatted: