From: Jan Kara Subject: Re: [PATCH 1/7] fsfreeze: Prevent emergency thaw from looping infinitely Date: Wed, 11 Jul 2012 11:02:30 +0200 Message-ID: <20120711090230.GC1316@quack.suse.cz> References: <1341908216.11559.6.camel@nexus.lab.ntt.co.jp> <1341908457.11559.9.camel@nexus.lab.ntt.co.jp> <20120710120858.GD13539@quack.suse.cz> <4FFCE434.601@lab.ntt.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Jan Kara , Al Viro , Dave Chinner , Christoph Hellwig , linux-fsdevel@vger.kernel.org To: Fernando Luis Vazquez Cao Return-path: Received: from cantor2.suse.de ([195.135.220.15]:58559 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751835Ab2GKJCg (ORCPT ); Wed, 11 Jul 2012 05:02:36 -0400 Content-Disposition: inline In-Reply-To: <4FFCE434.601@lab.ntt.co.jp> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed 11-07-12 11:25:56, Fernando Luis Vazquez Cao wrote: > On 2012/07/10 21:08, Jan Kara wrote: >=20 > >On Tue 10-07-12 17:20:57, Fernando Luis V=E1zquez Cao wrote: > >>The thawing of a filesystem through sysrq-j loops infinitely as it > >>incorrectly detects a thawed filesytsem as frozen and tries to > >>unfreeze repeatedly. This is a regression caused by > >>4504230a71566785a05d3e6b53fa1ee071b864eb ("freeze_bdev: grab active > >>reference to frozen superblocks") in that it no longer returned > >>-EINVAL for superblocks that were not frozen. > > Umm, I don't think above mentioned commit is really guilty. >=20 > Well, it is after that commit that >=20 > - if (!bdev->bd_fsfreeze_count) { > - mutex_unlock(&bdev->bd_fsfreeze_mutex); > - return -EINVAL; > - } >=20 > became >=20 > + if (!bdev->bd_fsfreeze_count) > + goto out_unlock; > [...] > +out_unlock: > mutex_unlock(&bdev->bd_fsfreeze_mutex); > return 0; >=20 > which breaks emergency thaw. Ah, OK. I misread the code... Sorry for the noise. > >Also I think your patch breaks thawing of a block device without mou= nted > >filesystem - you end up returning EINVAL for that... >=20 > It returns EINVAL only after the last thaw and the block device > is still properly thawed (i.e. bd_fsfreeze_count becomes 0). Yes, after your patch thaw_bdev() returns EINVAL although the device = is thawed. That is just wrong regardless whether any caller cares or not. = And before your patch this was working correctly. So please fix your patch. Honza --=20 Jan Kara SUSE Labs, CR -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html