From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752318AbbGJAto (ORCPT ); Thu, 9 Jul 2015 20:49:44 -0400 Received: from ipmail05.adl6.internode.on.net ([150.101.137.143]:53099 "EHLO ipmail05.adl6.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751826AbbGJAta (ORCPT ); Thu, 9 Jul 2015 20:49:30 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AuDAALFp9VPLC2LXlbgxJUYIZOogcMAQEBAQEBBpQthXkEAgKBVE0BAQEBAQEHAQEBAUABP4QkAQEEJxMcIxAIAw4KCSUPBSUDBxoTiC3PKgEBCAIgGIYFhS6FBgeEKwEElC2EZ4cYmGiBCYMqLDGCSwEBAQ Date: Fri, 10 Jul 2015 10:49:21 +1000 From: Dave Chinner To: Lukas Czerner Cc: viro@ZenIV.linux.org.uk, bfields@fieldses.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [RFC][PATCH] fs: Prevent syncing frozen file system Message-ID: <20150710004921.GJ3902@dastard> References: <1436463945-12556-1-git-send-email-lczerner@redhat.com> <20150709234012.GI3902@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150709234012.GI3902@dastard> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 10, 2015 at 09:40:12AM +1000, Dave Chinner wrote: > On Thu, Jul 09, 2015 at 07:45:45PM +0200, Lukas Czerner wrote: > > Currently we can end up in a deadlock because of broken > > sb_start_write -> s_umount ordering. > > > > The race goes like this: > > > > - write the file > > - unlink the file - final_iput will not be calles as file is opened > > - freeze the file system > > - Now simultaneously close the file and call sync (or syncfs on that > > particular file system). Sync will get to wait_sb_inodes() where it will > > grab the referece to the inode (__iget()) and later to call iput(). > > This problem goes away with the sync scalability patchset that josef > has been trying to get merged: > > git://git.kernel.org/pub/scm/linux/kernel/git/josef/btrfs-next.git superblock-scaling > > That patchset removes the full sb inodes list walk in > wait_sb_inodes() and replaces it with a walk of inodes cleaned > during the sync, which will be an empty list in the case of sync > running on an empty filesystem. This commit does the work: s/empty/frozen -Dave. -- Dave Chinner david@fromorbit.com