From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kara Subject: Re: [PATCH 7/17] fsfreeze: fix nested freezing of sb-less bdevs Date: Wed, 9 Jan 2013 17:24:38 +0100 Message-ID: <20130109162438.GC17353@quack.suse.cz> References: <1357557492.8183.1.camel@nexus.lab.ntt.co.jp> <1357558238.8183.12.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]:55584 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932162Ab3AIQYk (ORCPT ); Wed, 9 Jan 2013 11:24:40 -0500 Content-Disposition: inline In-Reply-To: <1357558238.8183.12.camel@nexus.lab.ntt.co.jp> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon 07-01-13 20:30:38, Fernando Luis V=E1zquez Cao wrote: > If a frozen bdev does not have a filesystem sitting on top of it any = subsequent > nested freeze will cause a null pointer dereference because freeze_bd= ev() > calls drop_super() unconditionally. drop_super() should be called onl= y when > there is a superblock to drop. Looks good. 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:38:05.072018000 += 0900 > +++ linux-3.8-rc1/fs/block_dev.c 2012-12-25 11:50:43.060018000 +0900 > @@ -227,8 +227,8 @@ struct super_block *freeze_bdev(struct b > * to freeze_bdev grab an active reference and only the last > * thaw_bdev drops it. > */ > - sb =3D get_super(bdev); > - drop_super(sb); > + if ((sb =3D get_super(bdev)) !=3D NULL) > + drop_super(sb); > mutex_unlock(&bdev->bd_fsfreeze_mutex); > return sb; > } >=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