From owner-freebsd-geom@FreeBSD.ORG Thu Jun 5 07:45:10 2008 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49ABA1065674; Thu, 5 Jun 2008 07:45:10 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from hosted.kievnet.com (hosted.kievnet.com [193.138.144.10]) by mx1.freebsd.org (Postfix) with ESMTP id ACF618FC14; Thu, 5 Jun 2008 07:45:09 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from localhost ([127.0.0.1] helo=edge.pp.kiev.ua) by hosted.kievnet.com with esmtpa (Exim 4.62) (envelope-from ) id 1K4A9j-00099Z-Fx; Thu, 05 Jun 2008 10:45:07 +0300 Message-ID: <4847997D.4060404@icyb.net.ua> Date: Thu, 05 Jun 2008 10:45:01 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.12 (X11/20080320) MIME-Version: 1.0 To: Kostik Belousov References: <4846AFC3.3050101@icyb.net.ua> <20080604152332.GE63348@deviant.kiev.zoral.com.ua> <4846B5D9.1050903@icyb.net.ua> <20080604161001.GF63348@deviant.kiev.zoral.com.ua> In-Reply-To: <20080604161001.GF63348@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=KOI8-U; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-fs@freebsd.org, freebsd-stable@freebsd.org, freebsd-geom@freebsd.org Subject: Re: mystery: lock up after fs dump X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2008 07:45:10 -0000 on 04/06/2008 19:10 Kostik Belousov said the following: > SU are irrelevant to the problem I am thinking of. > > vfs_write_suspend() returns 0 when the filesystem being suspended is already > in suspend state. vfs_write_resume() clears the suspend state. > > vfs_write_suspend/vfs_write_resume are used both by snapshot code and > the gjournal. If two users of these interfaces interleave, then you could > get: > > thread1 thread2 > > vfs_write_suspend() > <- fs is suspended there > vfs_write_suspend() <- returns 0 > vfs_write_resume() > <- fs is no more suspended > thread2 is burned in flame > > Snapshots are protected against this because they are created through > the mount(2). The mount(2) locks the covered vnode and thus serializes > snapshot creation (I think there are further serialization points that > prevent simultaneous snapshotting of the same fs). > > There is nothing I can see that protects snapshots/gjournal interaction. Looks like something to be quite concerned about. Thank you for the analysis. -- Andriy Gapon