Skip to content

Commit

Permalink
Btrfs: delay iput with async extents
Browse files Browse the repository at this point in the history
There is some concern that these iput()'s could be the final iputs and could
induce lockups on people waiting on writeback.  This would happen in the
rare case that we don't create ordered extents because of an error, but it
is theoretically possible and we already have a mechanism to deal with this
so just make them delayed iputs to negate any worry.

Signed-off-by: Josef Bacik <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
  • Loading branch information
Josef Bacik authored and Chris Mason committed Jun 21, 2012
1 parent e18fca7 commit cb77fcd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ static noinline void async_cow_start(struct btrfs_work *work)
async_cow->start, async_cow->end, async_cow,
&num_added);
if (num_added == 0) {
iput(async_cow->inode);
btrfs_add_delayed_iput(async_cow->inode);
async_cow->inode = NULL;
}
}
Expand Down Expand Up @@ -1023,7 +1023,7 @@ static noinline void async_cow_free(struct btrfs_work *work)
struct async_cow *async_cow;
async_cow = container_of(work, struct async_cow, work);
if (async_cow->inode)
iput(async_cow->inode);
btrfs_add_delayed_iput(async_cow->inode);
kfree(async_cow);
}

Expand Down

0 comments on commit cb77fcd

Please sign in to comment.