diff options
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r-- | fs/btrfs/transaction.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 27c26004e050..730c94590c9f 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -1229,6 +1229,14 @@ static void do_async_commit(struct work_struct *work) | |||
1229 | struct btrfs_async_commit *ac = | 1229 | struct btrfs_async_commit *ac = |
1230 | container_of(work, struct btrfs_async_commit, work.work); | 1230 | container_of(work, struct btrfs_async_commit, work.work); |
1231 | 1231 | ||
1232 | /* | ||
1233 | * We've got freeze protection passed with the transaction. | ||
1234 | * Tell lockdep about it. | ||
1235 | */ | ||
1236 | rwsem_acquire_read( | ||
1237 | &ac->root->fs_info->sb->s_writers.lock_map[SB_FREEZE_FS-1], | ||
1238 | 0, 1, _THIS_IP_); | ||
1239 | |||
1232 | btrfs_commit_transaction(ac->newtrans, ac->root); | 1240 | btrfs_commit_transaction(ac->newtrans, ac->root); |
1233 | kfree(ac); | 1241 | kfree(ac); |
1234 | } | 1242 | } |
@@ -1258,6 +1266,14 @@ int btrfs_commit_transaction_async(struct btrfs_trans_handle *trans, | |||
1258 | atomic_inc(&cur_trans->use_count); | 1266 | atomic_inc(&cur_trans->use_count); |
1259 | 1267 | ||
1260 | btrfs_end_transaction(trans, root); | 1268 | btrfs_end_transaction(trans, root); |
1269 | |||
1270 | /* | ||
1271 | * Tell lockdep we've released the freeze rwsem, since the | ||
1272 | * async commit thread will be the one to unlock it. | ||
1273 | */ | ||
1274 | rwsem_release(&root->fs_info->sb->s_writers.lock_map[SB_FREEZE_FS-1], | ||
1275 | 1, _THIS_IP_); | ||
1276 | |||
1261 | schedule_delayed_work(&ac->work, 0); | 1277 | schedule_delayed_work(&ac->work, 0); |
1262 | 1278 | ||
1263 | /* wait for transaction to start and unblock */ | 1279 | /* wait for transaction to start and unblock */ |