Skip to content

Commit

Permalink
Btrfs: remove residual code in delayed inode async helper
Browse files Browse the repository at this point in the history
Before applying the patch
  commit de3cb94
  title: Btrfs: improve the delayed inode throttling

We need requeue the async work after the current work was done, it
introduced a deadlock problem. So we wrote the code that this patch
removes to avoid the above problem. But after applying the above
patch, the deadlock problem didn't exist. So we should remove that
fix code.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
  • Loading branch information
Miao Xie authored and masoncl committed Jan 28, 2014
1 parent efe120a commit 74c40f9
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions fs/btrfs/delayed-inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1300,33 +1300,6 @@ static void btrfs_async_run_delayed_root(struct btrfs_work *work)
trans->block_rsv = &root->fs_info->delayed_block_rsv;

__btrfs_commit_inode_delayed_items(trans, path, delayed_node);
/*
* Maybe new delayed items have been inserted, so we need requeue
* the work. Besides that, we must dequeue the empty delayed nodes
* to avoid the race between delayed items balance and the worker.
* The race like this:
* Task1 Worker thread
* count == 0, needn't requeue
* also needn't insert the
* delayed node into prepare
* list again.
* add lots of delayed items
* queue the delayed node
* already in the list,
* and not in the prepare
* list, it means the delayed
* node is being dealt with
* by the worker.
* do delayed items balance
* the delayed node is being
* dealt with by the worker
* now, just wait.
* the worker goto idle.
* Task1 will sleep until the transaction is commited.
*/
mutex_lock(&delayed_node->mutex);
btrfs_dequeue_delayed_node(root->fs_info->delayed_root, delayed_node);
mutex_unlock(&delayed_node->mutex);

trans->block_rsv = block_rsv;
btrfs_end_transaction_dmeta(trans, root);
Expand Down

0 comments on commit 74c40f9

Please sign in to comment.