diff options
author | Chris Mason <clm@fb.com> | 2016-12-08 20:55:03 -0500 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2016-12-11 18:27:15 -0500 |
commit | 7c4c71ac8a72aea595f4cc7e09c2bcc61929c4ac (patch) | |
tree | ad675b9a57b2cb4cd2a691f7340a56eeaf952d1c | |
parent | e5d6b12fe14e89ea1c494585c47b1dfb31d71183 (diff) |
Revert "Btrfs: adjust len of writes if following a preallocated extent"
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 a23eaa875f0f1d89eb866b8c9860e78273ff5daf.
Signed-off-by: Chris Mason <clm@fb.com>
-rw-r--r-- | fs/btrfs/inode.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index dbcec1ced85a..a713d9d324b0 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -7765,12 +7765,10 @@ static int btrfs_get_blocks_direct(struct inode *inode, sector_t iblock, | |||
7765 | } | 7765 | } |
7766 | 7766 | ||
7767 | /* | 7767 | /* |
7768 | * this will cow the extent, if em is within [start, len], then | 7768 | * this will cow the extent, reset the len in case we changed |
7769 | * probably we've found a preallocated/existing extent, let's | 7769 | * it above |
7770 | * give it a chance to use preallocated space. | ||
7771 | */ | 7770 | */ |
7772 | len = min_t(u64, bh_result->b_size, em->len - (start - em->start)); | 7771 | len = bh_result->b_size; |
7773 | len = ALIGN(len, fs_info->sectorsize); | ||
7774 | free_extent_map(em); | 7772 | free_extent_map(em); |
7775 | em = btrfs_new_extent_direct(inode, start, len); | 7773 | em = btrfs_new_extent_direct(inode, start, len); |
7776 | if (IS_ERR(em)) { | 7774 | if (IS_ERR(em)) { |