Skip to content

Commit

Permalink
Revert "Btrfs: adjust len of writes if following a preallocated extent"
Browse files Browse the repository at this point in the history
This is exposing an existing deadlock between fsync and AIO.  Until we
have the deadlock fixed, I'm pulling this one out.

This reverts commit a23eaa8.

Signed-off-by: Chris Mason <[email protected]>
  • Loading branch information
masoncl committed Dec 11, 2016
1 parent e5d6b12 commit 7c4c71a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -7765,12 +7765,10 @@ static int btrfs_get_blocks_direct(struct inode *inode, sector_t iblock,
}

/*
* this will cow the extent, if em is within [start, len], then
* probably we've found a preallocated/existing extent, let's
* give it a chance to use preallocated space.
* this will cow the extent, reset the len in case we changed
* it above
*/
len = min_t(u64, bh_result->b_size, em->len - (start - em->start));
len = ALIGN(len, fs_info->sectorsize);
len = bh_result->b_size;
free_extent_map(em);
em = btrfs_new_extent_direct(inode, start, len);
if (IS_ERR(em)) {
Expand Down

0 comments on commit 7c4c71a

Please sign in to comment.