From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kara Subject: Re: [PATCH 1/7] fsfreeze: Prevent emergency thaw from looping infinitely Date: Tue, 10 Jul 2012 14:08:58 +0200 Message-ID: <20120710120858.GD13539@quack.suse.cz> References: <1341908216.11559.6.camel@nexus.lab.ntt.co.jp> <1341908457.11559.9.camel@nexus.lab.ntt.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Al Viro , Dave Chinner , Christoph Hellwig , linux-fsdevel@vger.kernel.org To: Fernando Luis =?iso-8859-1?Q?V=E1zquez?= Cao Return-path: Received: from cantor2.suse.de ([195.135.220.15]:36997 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752460Ab2GJMJC (ORCPT ); Tue, 10 Jul 2012 08:09:02 -0400 Content-Disposition: inline In-Reply-To: <1341908457.11559.9.camel@nexus.lab.ntt.co.jp> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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. Also I th= ink your patch breaks thawing of a block device without mounted filesystem = - you end up returning EINVAL for that... Honza >=20 > Return -EINVAL when the filesystem is already unfrozen to avoid this > problem. >=20 > Cc: Christoph Hellwig > Signed-off-by: Dave Chinner > Signed-off-by: Fernando Luis Vazquez Cao > --- >=20 > diff -urNp linux-3.5-rc4-orig/fs/block_dev.c linux-3.5-rc4/fs/block_d= ev.c > --- linux-3.5-rc4-orig/fs/block_dev.c 2012-06-27 12:00:47.694616000 += 0900 > +++ linux-3.5-rc4/fs/block_dev.c 2012-06-29 13:38:23.841352532 +0900 > @@ -319,22 +319,20 @@ int thaw_bdev(struct block_device *bdev, > if (!bdev->bd_fsfreeze_count) > goto out; > =20 > - error =3D 0; > - if (--bdev->bd_fsfreeze_count > 0) > + if (--bdev->bd_fsfreeze_count > 0) { > + error =3D 0; > goto out; > + } > =20 > if (!sb) > goto out; > =20 > error =3D thaw_super(sb); > - if (error) { > + if (error) > bdev->bd_fsfreeze_count++; > - mutex_unlock(&bdev->bd_fsfreeze_mutex); > - return error; > - } > out: > mutex_unlock(&bdev->bd_fsfreeze_mutex); > - return 0; > + return error; > } > EXPORT_SYMBOL(thaw_bdev); > =20 >=20 >=20 > -- > To unsubscribe from this list: send the line "unsubscribe linux-fsdev= el" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html --=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