From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH] wake up s_wait_unfrozen when ->freeze_fs fails Date: Tue, 6 Dec 2011 10:20:31 -0500 Message-ID: <20111206152031.GA15613@infradead.org> References: <4ED731EB.2040104@sx.jp.nec.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org To: Kazuya Mio Return-path: Received: from 173-166-109-252-newengland.hfc.comcastbusiness.net ([173.166.109.252]:40454 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753731Ab1LFPUd (ORCPT ); Tue, 6 Dec 2011 10:20:33 -0500 Content-Disposition: inline In-Reply-To: <4ED731EB.2040104@sx.jp.nec.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Dec 01, 2011 at 04:51:07PM +0900, Kazuya Mio wrote: > dd slept infinitely when fsfeeze failed because of EIO. > To fix this problem, if ->freeze_fs fails, freeze_super() wakes up > the tasks waiting for the filesystem to become unfrozen. > > When s_frozen isn't SB_UNFROZEN in __generic_file_aio_write(), > the function sleeps until FITHAW ioctl wakes up s_wait_unfrozen. > > However, if ->freeze_fs fails, s_frozen is set to SB_UNFROZEN and then > freeze_super() returns an error number. In this case, FITHAW ioctl returns > EINVAL because s_frozen is already SB_UNFROZEN. There is no way to wake up > s_wait_unfrozen, so __generic_file_aio_write() sleeps infinitely. Looks good, Reviewed-by: Christoph Hellwig You don't happen to have testcase (e.g. by using dm-fauly or XFS error injection) that we could add to xfstests for this?