diff options
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r-- | fs/btrfs/file.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 7cbf8d8d7e27..184bde1cfc3d 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c | |||
@@ -265,16 +265,14 @@ static int noinline dirty_and_release_pages(struct btrfs_trans_handle *trans, | |||
265 | set_extent_uptodate(io_tree, start_pos, end_of_last_block, GFP_NOFS); | 265 | set_extent_uptodate(io_tree, start_pos, end_of_last_block, GFP_NOFS); |
266 | 266 | ||
267 | /* FIXME...EIEIO, ENOSPC and more */ | 267 | /* FIXME...EIEIO, ENOSPC and more */ |
268 | |||
269 | /* insert any holes we need to create */ | 268 | /* insert any holes we need to create */ |
270 | if (inode->i_size < start_pos) { | 269 | if (isize < end_pos) { |
271 | u64 last_pos_in_file; | 270 | u64 last_pos_in_file; |
272 | u64 hole_size; | 271 | u64 hole_size; |
273 | u64 mask = root->sectorsize - 1; | 272 | u64 mask = root->sectorsize - 1; |
274 | last_pos_in_file = (isize + mask) & ~mask; | 273 | last_pos_in_file = (isize + mask) & ~mask; |
275 | hole_size = (end_pos - last_pos_in_file + mask) & ~mask; | 274 | hole_size = (end_pos - last_pos_in_file + mask) & ~mask; |
276 | 275 | if (last_pos_in_file < end_pos) { | |
277 | if (last_pos_in_file < start_pos) { | ||
278 | err = btrfs_drop_extents(trans, root, inode, | 276 | err = btrfs_drop_extents(trans, root, inode, |
279 | last_pos_in_file, | 277 | last_pos_in_file, |
280 | last_pos_in_file + hole_size, | 278 | last_pos_in_file + hole_size, |