From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934242AbYD1NE0 (ORCPT ); Mon, 28 Apr 2008 09:04:26 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S934190AbYD1NEB (ORCPT ); Mon, 28 Apr 2008 09:04:01 -0400 Received: from bombadil.infradead.org ([18.85.46.34]:47654 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934182AbYD1ND7 (ORCPT ); Mon, 28 Apr 2008 09:03:59 -0400 Date: Mon, 28 Apr 2008 09:03:58 -0400 From: Christoph Hellwig To: Takashi Sato Cc: Christoph Hellwig , linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 1/3] Implement generic freeze feature Message-ID: <20080428130358.GB2798@infradead.org> References: <20080428193123t-sato@mail.jp.nec.com> <20080428103719.GA16030@infradead.org> <2E042A67F72447F6AAA0CC0605DBFA84@nsl.ad.nec.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2E042A67F72447F6AAA0CC0605DBFA84@nsl.ad.nec.co.jp> User-Agent: Mutt/1.5.17 (2007-11-01) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 28, 2008 at 09:59:55PM +0900, Takashi Sato wrote: >> I think the protection against double freezes would be better done by >> using a trylock on bd_mount_sem. > > bd_mount_sem can protect against only freezes and cannot protect against > unfreezes. If multiple unfreezes run in parallel, the multiple up() for > bd_mount_sem might occur incorrectly. Indeed. The bit flag would fix that because unfreeze could then check for the bit beeing set first. So that's probably the easiest way to go.