From patchwork Tue Mar 23 14:28:18 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 87637 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2NESL2F020813 for ; Tue, 23 Mar 2010 14:28:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752422Ab0CWO2U (ORCPT ); Tue, 23 Mar 2010 10:28:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46551 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752522Ab0CWO2T (ORCPT ); Tue, 23 Mar 2010 10:28:19 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2NESJLS024059 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 23 Mar 2010 10:28:19 -0400 Received: from localhost.localdomain (vpn-8-75.rdu.redhat.com [10.11.8.75]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2NESIdq019563 for ; Tue, 23 Mar 2010 10:28:18 -0400 Date: Tue, 23 Mar 2010 10:28:18 -0400 From: Josef Bacik To: linux-btrfs@vger.kernel.org Subject: [PATCH] Btrfs: fix how we freeze Message-ID: <20100323142818.GB2381@localhost.localdomain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 23 Mar 2010 14:28:21 +0000 (UTC) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 9ac612e..c9ded47 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -811,17 +811,11 @@ static long btrfs_control_ioctl(struct file *file, unsigned int cmd, static int btrfs_freeze(struct super_block *sb) { - struct btrfs_root *root = btrfs_sb(sb); - mutex_lock(&root->fs_info->transaction_kthread_mutex); - mutex_lock(&root->fs_info->cleaner_mutex); return 0; } static int btrfs_unfreeze(struct super_block *sb) { - struct btrfs_root *root = btrfs_sb(sb); - mutex_unlock(&root->fs_info->cleaner_mutex); - mutex_unlock(&root->fs_info->transaction_kthread_mutex); return 0; } diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 2d654c1..c3bc9ba 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -176,6 +176,8 @@ static struct btrfs_trans_handle *start_transaction(struct btrfs_root *root, kmem_cache_alloc(btrfs_trans_handle_cachep, GFP_NOFS); int ret; + vfs_check_frozen(root->fs_info->sb, SB_FREEZE_TRANS); + mutex_lock(&root->fs_info->trans_mutex); if (!root->fs_info->log_root_recovering && ((type == TRANS_START && !root->fs_info->open_ioctl_trans) ||