From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH 2/5] fsfreeze: emergency thaw will deadlock on s_umount Date: Mon, 14 Jun 2010 11:20:11 -0400 Message-ID: <20100614152011.GB32354@infradead.org> References: <1276154395-24766-1-git-send-email-david@fromorbit.com> <1276154395-24766-3-git-send-email-david@fromorbit.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, viro@ZenIV.linux.org.uk, josef@redhat.com, jeffmerkey@gmail.com To: Dave Chinner Return-path: Content-Disposition: inline In-Reply-To: <1276154395-24766-3-git-send-email-david@fromorbit.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Thu, Jun 10, 2010 at 05:19:51PM +1000, Dave Chinner wrote: > The emergency thaw process uses iterate_super() which holds the > sb->s_umount lock in read mode. The current thaw_super() code takes > the sb->s_umount lock in write mode, hence leading to an instant > deadlock. > > Pass the emergency state into the thaw_bdev/thaw_super code to avoid > taking the s_umount lock in this case. We are running under the bdev > freeze mutex, so this is still serialised against freeze despite > only having a read lock on the sb->s_umount. Hence it should be safe > to execute in this manner, especially given that emergency thaw is a > rarely executed "get-out-of-jail" feature. This is correct as long as no one calls thaw_super directly, which is not the case currently.