Need to force sync(2) before umounting UFS1 filesystems?

From: Garrett Cooper <yanegomi_at_gmail.com>
Date: Sun, 25 Sep 2011 01:06:05 -0700
Hi,
    I've been doing builds with FreeNAS recently on 9.x-BETA2 machines
recently and I've noticed that I need to add 2 'sync's prior to each
umount command in the nanobsd scripts when running repeated builds,
otherwise it fails with:

umount: unmount of /scratch/freenas/obj.amd64/_.mnt failed: Device busy

    Running fstat -f in the sh EXIT trap doesn't reveal anything helpful:

USER     CMD          PID   FD MOUNT      INUM MODE         SZ|DV R/W
root     fstat      79637   wd /scratch/freenas/obj.amd64/_.mnt      2
drwxr-xr-x     512  r

    Talking to Xin yesterday, he was convinced that this was a
filesystem//kern bug. Before I file a PR, I'm wondering if anyone else
has seen this issue..
Thanks!
-Garrett

PS I've seen the above behavior on the following systems..

FreeBSD bayonetta.local 9.0-BETA2 FreeBSD 9.0-BETA2 #0 r225653M: Tue
Sep 20 08:36:49 PDT 2011
gcooper_at_bayonetta.local:/usr/obj/usr/src/sys/BAYONETTA  amd64

FreeBSD burnout.ixsystems.com 9.0-BETA1 FreeBSD 9.0-BETA1 #0 r224989:
Sun Aug 21 14:12:11 PDT 2011
gcooper_at_burnout.ixsystems.com:/usr/obj/usr/src/sys/BURNOUT  amd64

FreeBSD fallout.local 9.0-BETA2 FreeBSD 9.0-BETA2 #10 r225587M: Thu
Sep 15 09:07:08 PDT 2011
root_at_fallout.local:/usr/obj/usr/src/sys/FALLOUT  amd64

FreeBSD streetfighter.ixsystems.com 9.0-BETA2 FreeBSD 9.0-BETA2 #0
r225558: Wed Sep 14 20:29:45 PDT 2011
gcooper_at_streetfighter.ixsystems.com:/usr/obj/usr/src/sys/STREETFIGHTER
 amd64
Received on Sun Sep 25 2011 - 06:06:08 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:18 UTC