From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kara Subject: Re: [PATCH 8/17] fsfreeze: allow bdev level thaws when the sb is unfrozen Date: Wed, 9 Jan 2013 17:26:25 +0100 Message-ID: <20130109162625.GD17353@quack.suse.cz> References: <1357557492.8183.1.camel@nexus.lab.ntt.co.jp> <1357558333.8183.13.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 , Josef Bacik , Eric Sandeen , Dave Chinner , Christoph Hellwig , Jan Kara , Luiz Capitulino , 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]:55666 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932132Ab3AIQ01 (ORCPT ); Wed, 9 Jan 2013 11:26:27 -0500 Content-Disposition: inline In-Reply-To: <1357558333.8183.13.camel@nexus.lab.ntt.co.jp> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon 07-01-13 20:32:13, Fernando Luis V=E1zquez Cao wrote: > This behavior is important in a scenario where a filesystem frozen us= ing > freeze_bdev() is thawed through the superblock level API; if we > caused subsequent calls to thaw_bdev() future calls to freeze_bdev() > would fail to freeze the superblock. >=20 > We can get rid of this code away once bdev level fsfreeze and sb leve= l > fsfreeze are properly integrated. OK, makes sence. You can add: Reviewed-by: Jan Kara Honza >=20 > Cc: linux-fsdevel@vger.kernel.org > Cc: Josef Bacik > Cc: Eric Sandeen > Cc: Christoph Hellwig > Cc: Jan Kara > Cc: Dave Chinner > Cc: Luiz Capitulino > Signed-off-by: Fernando Luis Vazquez Cao > --- >=20 > diff -urNp linux-3.8-rc1-orig/fs/block_dev.c linux-3.8-rc1/fs/block_d= ev.c > --- linux-3.8-rc1-orig/fs/block_dev.c 2012-12-25 11:52:04.344018000 += 0900 > +++ linux-3.8-rc1/fs/block_dev.c 2012-12-25 16:11:12.648018000 +0900 > @@ -272,8 +272,19 @@ int thaw_bdev(struct block_device *bdev, > } > =20 > error =3D thaw_super(sb); > - if (error) > + /* > + * If the superblock is already unfrozen, i.e. thaw_super() returne= d > + * -EINVAL, we consider the block device level thaw successful. Thi= s > + * behavior is important in a scenario where a filesystem frozen us= ing > + * freeze_bdev() is thawed through the superblock level API; if we > + * caused the subsequent thaw_bdev() to fail bdev->bd_fsfreeze_coun= t > + * would not go back to 0 which means that future calls to freeze_b= dev() > + * would not freeze the superblock, just increase the counter. > + */ > + if (error && error !=3D -EINVAL) > bdev->bd_fsfreeze_count++; > + else > + error =3D 0; > out: > mutex_unlock(&bdev->bd_fsfreeze_mutex); > return error; >=20 >=20 --=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