From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753296Ab2BDCnB (ORCPT ); Fri, 3 Feb 2012 21:43:01 -0500 Received: from sandeen.net ([63.231.237.45]:38884 "EHLO mail.sandeen.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750783Ab2BDCm7 (ORCPT ); Fri, 3 Feb 2012 21:42:59 -0500 Message-ID: <4F2C9B30.1030902@sandeen.net> Date: Fri, 03 Feb 2012 20:42:56 -0600 From: Eric Sandeen User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0) Gecko/20120129 Thunderbird/10.0 MIME-Version: 1.0 To: Jan Kara CC: linux-fsdevel@vger.kernel.org, Dave Chinner , Surbhi Palande , Kamal Mostafa , Christoph Hellwig , LKML , xfs@oss.sgi.com, linux-ext4@vger.kernel.org Subject: Re: [PATCH 6/8] xfs: Use generic writers counter instead of m_active_trans counter References: <1327091686-23177-1-git-send-email-jack@suse.cz> <1327091686-23177-7-git-send-email-jack@suse.cz> In-Reply-To: <1327091686-23177-7-git-send-email-jack@suse.cz> X-Enigmail-Version: 1.3.5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/20/12 2:34 PM, Jan Kara wrote: > m_active_trans counter is racy wrt filesystem freezing. The patch replaces it > with generic counter of running transactions which is properly synchronized > with filesystem freezing. Things are a bit more complex because we need to log > a dummy transaction and free block counters after the filesystem is frozen so > we need to pass information to _xfs_trans_alloc() whether the transaction is > part of filesystem freezing or not. > > Signed-off-by: Jan Kara > --- ... > xfs_trans_t * > _xfs_trans_alloc( > xfs_mount_t *mp, > uint type, > - uint memflags) > + uint memflags, > + bool freezing) > { > xfs_trans_t *tp; > > - atomic_inc(&mp->m_active_trans); > - > + if (!freezing) > + sb_start_write(mp->m_super, SB_FREEZE_TRANS); > + else > + WARN_ON(xfs_test_for_freeze(mp) != SB_FREEZE_TRANS); Hm this could be an issue because for both the umount path and the freeze / xfs_quiesce_attr path, we call xfs_log_sbcount which sends "true" for freezing and we'll trip up here because we won't be in SB_FREEZE_TRANS during umount. I think we have to push the flag all the way up to xfs_log_sbcount callers? -Eric