kern/157869: easy to create zvols that cannot be forgotten

Garrett Wollman wollman at FreeBSD.org
Tue Jun 14 07:30:13 UTC 2011


>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 at 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 at 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 at 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 at backup-2011-0
crw-r-----  1 root  operator    1,  22 Jun 14 02:31 devbox-9.0-current at backup-2011-0
crw-r-----  1 root  operator    1,  22 Jun 14 02:31 devbox-9.0-current at backup-2011-0
crw-r-----  1 root  operator    1,  22 Jun 14 02:31 devbox-9.0-current at backup-2011-0
crw-r-----  1 root  operator    1,  22 Jun 14 02:31 devbox-9.0-current at backup-2011-0
crw-r-----  1 root  operator    1,  22 Jun 14 02:31 devbox-9.0-current at backup-2011-0
crw-r-----  1 root  operator    1,  22 Jun 14 02:31 devbox-9.0-current at backup-2011-0
crw-r-----  1 root  operator    1,  22 Jun 14 02:31 devbox-9.0-current at 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:


More information about the freebsd-bugs mailing list