Skip to content

Commit

Permalink
btrfs: Handle btrfs_set_extent_delalloc failure in relocate_file_exte…
Browse files Browse the repository at this point in the history
…nt_cluster

Essentially duplicate the error handling from the above block which
handles the !PageUptodate(page) case and additionally clear
EXTENT_BOUNDARY.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
Nikolay Borisov authored and David Sterba committed Mar 1, 2018
1 parent ac01f26 commit 765f3ce
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions fs/btrfs/relocation.c
Original file line number Diff line number Diff line change
Expand Up @@ -3268,8 +3268,22 @@ static int relocate_file_extent_cluster(struct inode *inode,
nr++;
}

btrfs_set_extent_delalloc(inode, page_start, page_end, 0, NULL,
0);
ret = btrfs_set_extent_delalloc(inode, page_start, page_end, 0,
NULL, 0);
if (ret) {
unlock_page(page);
put_page(page);
btrfs_delalloc_release_metadata(BTRFS_I(inode),
PAGE_SIZE);
btrfs_delalloc_release_extents(BTRFS_I(inode),
PAGE_SIZE);

clear_extent_bits(&BTRFS_I(inode)->io_tree,
page_start, page_end,
EXTENT_LOCKED | EXTENT_BOUNDARY);
goto out;

}
set_page_dirty(page);

unlock_extent(&BTRFS_I(inode)->io_tree,
Expand Down

0 comments on commit 765f3ce

Please sign in to comment.