Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 310825
b: refs/heads/master
c: 8180ef8
h: refs/heads/master
i:
  310823: 84cbae8
v: v3
  • Loading branch information
Josef Bacik authored and Chris Mason committed Jun 15, 2012
1 parent 3af0e7c commit 6319466
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9c5085c147989d48dfe74194b48affc23f376650
refs/heads/master: 8180ef8894fa402443205cff1e23417e8d3434df
8 changes: 6 additions & 2 deletions trunk/fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -986,8 +986,10 @@ static noinline void async_cow_start(struct btrfs_work *work)
compress_file_range(async_cow->inode, async_cow->locked_page,
async_cow->start, async_cow->end, async_cow,
&num_added);
if (num_added == 0)
if (num_added == 0) {
iput(async_cow->inode);
async_cow->inode = NULL;
}
}

/*
Expand Down Expand Up @@ -1020,6 +1022,8 @@ 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);
kfree(async_cow);
}

Expand All @@ -1038,7 +1042,7 @@ static int cow_file_range_async(struct inode *inode, struct page *locked_page,
while (start < end) {
async_cow = kmalloc(sizeof(*async_cow), GFP_NOFS);
BUG_ON(!async_cow); /* -ENOMEM */
async_cow->inode = inode;
async_cow->inode = igrab(inode);
async_cow->root = root;
async_cow->locked_page = locked_page;
async_cow->start = start;
Expand Down

0 comments on commit 6319466

Please sign in to comment.