From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kara Subject: Re: [PATCH] udf: Fix deadlock when converting file from in-ICB one to normal one Date: Mon, 12 Dec 2011 15:22:27 +0100 Message-ID: <20111212142227.GB5473@quack.suse.cz> References: <1323483097-24210-1-git-send-email-jack@suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Jan Kara , LKML , linux-fsdevel@vger.kernel.org, Matthias Matiak To: Namjae Jeon Return-path: Received: from cantor2.suse.de ([195.135.220.15]:56407 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750790Ab1LLPGg (ORCPT ); Mon, 12 Dec 2011 10:06:36 -0500 Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Sat 10-12-11 13:40:53, Namjae Jeon wrote: > 2011/12/10 Jan Kara : > > During BKL removal, conversion of files from in-ICB format to norma= l format got > > broken. We call ->writepage with i_data_sem held but udf_get_block(= ) also > > acquires i_data_sem thus creating A-A deadlock. > > > > We fix the problem by dropping i_data_sem before calling ->writepag= e() which is > > safe since i_mutex still protects us against any changes in the fil= e. Also fix > > pagelock - i_data_sem lock inversion in udf_expand_file_adinicb() b= y dropping > > i_data_sem before calling find_or_create_page(). > > > > Reported-by: Matthias Matiak > > Signed-off-by: Jan Kara > Reviewed-by: Namjae Jeon Thanks. > > --- > > =A0fs/udf/file.c =A0| =A0 =A06 +++--- > > =A0fs/udf/inode.c | =A0 20 +++++++++++++++++--- > > =A02 files changed, 20 insertions(+), 6 deletions(-) > > > > =A0I plan to merge this fix through my tree soon. > > > > +/* > > + * Expand file stored in ICB to a normal one-block-file > > + * > > + * This function requires i_data_sem for writing and releases it. > > + * This function requires i_mutex held > > + */ > > =A0int udf_expand_file_adinicb(struct inode *inode) > > =A0{ > > =A0 =A0 =A0 =A0struct page *page; > > @@ -171,6 +177,11 @@ int udf_expand_file_adinicb(struct inode *inod= e) > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0mark_inode_dirty(inode); > up_write(&iinfo->i_data_sem); > Hi Jan. > I do not know if that helps, Would it need here ? Thanks for spotting this! Indeed it was a bug not to release i_data_s= em here! I have fixed it now. 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