Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 360433
b: refs/heads/master
c: 0bec9ef
h: refs/heads/master
i:
  360431: 649fa5c
v: v3
  • Loading branch information
Josef Bacik committed Feb 20, 2013
1 parent 59f4f70 commit 34efab5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 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: 779880ef35b60ac82eed1dcaec6db5b34a170df8
refs/heads/master: 0bec9ef525e33233d7739b71be83bb78746f6e94
14 changes: 13 additions & 1 deletion trunk/fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -2022,11 +2022,23 @@ static int btrfs_finish_ordered_io(struct btrfs_ordered_extent *ordered_extent)
if (trans)
btrfs_end_transaction(trans, root);

if (ret)
if (ret) {
clear_extent_uptodate(io_tree, ordered_extent->file_offset,
ordered_extent->file_offset +
ordered_extent->len - 1, NULL, GFP_NOFS);

/*
* If the ordered extent had an IOERR or something else went
* wrong we need to return the space for this ordered extent
* back to the allocator.
*/
if (!test_bit(BTRFS_ORDERED_NOCOW, &ordered_extent->flags) &&
!test_bit(BTRFS_ORDERED_PREALLOC, &ordered_extent->flags))
btrfs_free_reserved_extent(root, ordered_extent->start,
ordered_extent->disk_len);
}


/*
* This needs to be done to make sure anybody waiting knows we are done
* updating everything for this ordered extent.
Expand Down

0 comments on commit 34efab5

Please sign in to comment.