From owner-freebsd-bugs@FreeBSD.ORG Sun Oct 9 20:10:03 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 59027106567A for ; Sun, 9 Oct 2011 20:10:03 +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 17D2B8FC12 for ; Sun, 9 Oct 2011 20:10:03 +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 p99KA267051816 for ; Sun, 9 Oct 2011 20:10:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p99KA2Hm051789; Sun, 9 Oct 2011 20:10:02 GMT (envelope-from gnats) Resent-Date: Sun, 9 Oct 2011 20:10:02 GMT Resent-Message-Id: <201110092010.p99KA2Hm051789@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 Cooper Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75DF2106564A for ; Sun, 9 Oct 2011 20:06:10 +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 175988FC0C for ; Sun, 9 Oct 2011 20:06:10 +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 p99K69oH041395 for ; Sun, 9 Oct 2011 20:06:09 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p99K69mQ041394; Sun, 9 Oct 2011 20:06:09 GMT (envelope-from nobody) Message-Id: <201110092006.p99K69mQ041394@red.freebsd.org> Date: Sun, 9 Oct 2011 20:06:09 GMT From: Garrett Cooper To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/161439: umount -a -t doesn't work with nested filesystems X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Oct 2011 20:10:03 -0000 >Number: 161439 >Category: kern >Synopsis: umount -a -t doesn't work with nested filesystems >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 Oct 09 20:10:02 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Garrett Cooper >Release: 10-CURRENT >Organization: n/a >Environment: FreeBSD fallout.local 10.0-CURRENT FreeBSD 10.0-CURRENT #1 r226046M: Wed Oct 5 22:06:21 PDT 2011 gcooper@fallout.local:/usr/obj/usr/src/sys/FALLOUT amd64 >Description: If one is trying to unmount just unionfs mounted directories, one cannot do it simply via 'umount -a -t unionfs' because it isn't popping filesystems off the stack and is instead dequeueing them based on the order allocated via getfsent(2). This isn't restricted to unionfs though, as shown in the reproduction case below. So simply put, unmounting nested filesystems via umount -a -t doesn't work today. >How-To-Repeat: #!/bin/sh for i in 0 1 2; do rm -f md.$i touch md.$i md=/dev/$(mdconfig -a -f md.$i -s 1g) fdisk -Iq $md mds="$mds $md" done t=tank v=zvol zpool create $t $mds zfs create $t/ds mount | grep "^$t" umount -a -t zfs >Fix: >From a high-level: 1. All of the available filesystems need to be gathered and sorted by mountpoint. 2. The filesystems should be popped off the stack and unmounted. >Release-Note: >Audit-Trail: >Unformatted: