Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Oct 2011 20:06:09 GMT
From:      Garrett Cooper <yanegomi@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/161439: umount -a -t <foo> doesn't work with nested filesystems
Message-ID:  <201110092006.p99K69mQ041394@red.freebsd.org>
Resent-Message-ID: <201110092010.p99KA2Hm051789@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         161439
>Category:       kern
>Synopsis:       umount -a -t <foo> 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 <foo> 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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201110092006.p99K69mQ041394>