From owner-freebsd-hackers@FreeBSD.ORG Wed May 6 21:28:14 2015 Return-Path: Delivered-To: freebsd-hackers@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 337078CA for ; Wed, 6 May 2015 21:28:14 +0000 (UTC) Received: from mail-qg0-x22a.google.com (mail-qg0-x22a.google.com [IPv6:2607:f8b0:400d:c04::22a]) (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 EDFB610F7 for ; Wed, 6 May 2015 21:28:13 +0000 (UTC) Received: by qgfi89 with SMTP id i89so11734686qgf.1 for ; Wed, 06 May 2015 14:28:13 -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=Ib+cjBOKnknCiO/SOpIajMwxN8TtPoKV7h7nOOUmgYU=; b=oGb7JsUrcwjQANlehHYEFgELdzKHPuTgaAYxNj9c78KZO+yJ/FdwQUuUYMFKjLdpCo TGO86+76htCMI2crzjciZfSDn3FrGCdY66EXfLK+1HxAZStSEXSldWXcgMWhVcASsUzJ e62UFn2TxTvlqqMifDBJ8cxC2Y+0QbBAmfHbtFJHhxiRDOzOcIpoF8Ugm9kqVDH/TrIw pE0TpEy9imWEzgO5bKYwhfPur4bfRSB8j3CQ20KjDTl2oPwQ5mDrZqqwNxwEHrTHvbPc 6/loqCx/re4ayv94JXtKUCo8oYwYp+dXYfaP78fXgh0CDSd1c767w6eQ224mXgDmtxSG pINA== MIME-Version: 1.0 X-Received: by 10.55.16.140 with SMTP id 12mr1668328qkq.39.1430947693015; Wed, 06 May 2015 14:28:13 -0700 (PDT) Received: by 10.140.98.66 with HTTP; Wed, 6 May 2015 14:28:12 -0700 (PDT) In-Reply-To: References: Date: Wed, 6 May 2015 14:28:12 -0700 Message-ID: Subject: Re: What's required to make removal of a mounted USB stick safe? From: NGie Cooper To: Ryan Stone Cc: "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 May 2015 21:28:14 -0000 On Wed, May 6, 2015 at 1:49 PM, Ryan Stone wrote: > Currently FreeBSD stands a fair chance at panicking if a mounted USB drive > is removed while I/O is in flight. Does anybody know what work is involved > to have the kernel safely recover from this case? Losing data from the > drive is expected of course but there's no reason that the entire kernel > has to crash. > > A co-worker has been looking at this but I don't feel that we understand > the problem well enough to produce a real fix. All that we've been doing > so far is papering over the explicit panics without having a full > understanding of what we're doing. What version are you working on and how is the USB stick mounted (/, /mnt, etc)? Thanks!