From 78871f0f3ffcc56933424434b3203c33c9b00610 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 30 Aug 2012 16:26:15 -0600 Subject: [PATCH] --- yaml --- r: 332532 b: refs/heads/master c: 6fc4e3548598d10a5e947797a09cbc1b257a22ab h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/btrfs/transaction.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 0e5d926e9c0d..59a5d685d15b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2aaa66558172b017f36bf38ae69372813dedee9d +refs/heads/master: 6fc4e3548598d10a5e947797a09cbc1b257a22ab diff --git a/trunk/fs/btrfs/transaction.c b/trunk/fs/btrfs/transaction.c index 27c26004e050..730c94590c9f 100644 --- a/trunk/fs/btrfs/transaction.c +++ b/trunk/fs/btrfs/transaction.c @@ -1229,6 +1229,14 @@ static void do_async_commit(struct work_struct *work) struct btrfs_async_commit *ac = container_of(work, struct btrfs_async_commit, work.work); + /* + * We've got freeze protection passed with the transaction. + * Tell lockdep about it. + */ + rwsem_acquire_read( + &ac->root->fs_info->sb->s_writers.lock_map[SB_FREEZE_FS-1], + 0, 1, _THIS_IP_); + btrfs_commit_transaction(ac->newtrans, ac->root); kfree(ac); } @@ -1258,6 +1266,14 @@ int btrfs_commit_transaction_async(struct btrfs_trans_handle *trans, atomic_inc(&cur_trans->use_count); btrfs_end_transaction(trans, root); + + /* + * Tell lockdep we've released the freeze rwsem, since the + * async commit thread will be the one to unlock it. + */ + rwsem_release(&root->fs_info->sb->s_writers.lock_map[SB_FREEZE_FS-1], + 1, _THIS_IP_); + schedule_delayed_work(&ac->work, 0); /* wait for transaction to start and unblock */