From owner-svn-src-all@FreeBSD.ORG Mon Mar 30 09:03:28 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 91047B03; Mon, 30 Mar 2015 09:03:28 +0000 (UTC) Received: from mail-qc0-x232.google.com (mail-qc0-x232.google.com [IPv6:2607:f8b0:400d:c01::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49153D80; Mon, 30 Mar 2015 09:03:28 +0000 (UTC) Received: by qcay5 with SMTP id y5so64908507qca.1; Mon, 30 Mar 2015 02:03:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=c0lIjex41xjXzMq7+6dMb/Ph8i0vcuhFeo/mqwrg+VI=; b=vjcYziWl8pwLt5voV9Lnu2bXKLlWZvKYeTZqfQsVaAkSzNYbMeJFCJo/2Bwc825uv8 3CLuUWp0Y8QZbJSVK52UMCxkDtpB7R8cLQuso/BDCY693+0xwQW02ynfp0hh2CMIPMqi 2dovqEGlzs2zalYCLzywca4RqHpqVif0mpJSIN9AoWlcRSFq6Z+iYaSueyp1ElKtBtQj 6GTduei802ZcC4vAXKfWwaIRiW2oCADvebNeAKc/BhJWOeNb6qDHoADtA2mqZDXYFLrC N1YjyhvOnQ02IKgtSFsGz9p4AkEm7xaMOtknM9e6MbRz1R0+AIcPO5QX5nwPv7cd8fed G5Gg== MIME-Version: 1.0 X-Received: by 10.140.32.52 with SMTP id g49mr39273919qgg.83.1427706207415; Mon, 30 Mar 2015 02:03:27 -0700 (PDT) Received: by 10.140.94.99 with HTTP; Mon, 30 Mar 2015 02:03:27 -0700 (PDT) In-Reply-To: <201503300833.t2U8XKfe056489@svn.freebsd.org> References: <201503300833.t2U8XKfe056489@svn.freebsd.org> Date: Mon, 30 Mar 2015 02:03:27 -0700 Message-ID: Subject: Re: svn commit: r280840 - head/release/tools From: NGie Cooper To: Colin Percival Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Mar 2015 09:03:28 -0000 On Mon, Mar 30, 2015 at 1:33 AM, Colin Percival wrote: > Author: cperciva > Date: Mon Mar 30 08:33:19 2015 > New Revision: 280840 > URL: https://svnweb.freebsd.org/changeset/base/280840 > > Log: > Clean up filesystem unmounting in vmimage builds: > * Remove vm_umount_base function which is currently unused. > * Add umount_loop function which loops attempting to unmount one filesystem. > * Replace calls to umount with calls to umount_loop. > * Don't attempt to unmount ${DESTDIR}/dev if it isn't mounted. > > The looping is necessary because sometimes umount fails due to filesystems > being busy. The most common cause of such busyness is periodic(8) jobs > running `find / ...`. > > Reviewed by: gjb > > Modified: > head/release/tools/vmimage.subr > > Modified: head/release/tools/vmimage.subr > ============================================================================== > --- head/release/tools/vmimage.subr Mon Mar 30 07:11:49 2015 (r280839) > +++ head/release/tools/vmimage.subr Mon Mar 30 08:33:19 2015 (r280840) > @@ -45,8 +45,10 @@ err() { > } > > cleanup() { > - umount ${DESTDIR}/dev 2>/dev/null > - umount ${DESTDIR} > + if mount | grep -qE "devfs on ${DESTDIR}/dev"; then > + umount_loop ${DESTDIR}/dev 2>/dev/null > + fi if [ -c "${DESTDIR}/dev" ]; then umount_loop fi etc, is probably more foolproof here.