Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 765f3ceb authored by Nikolay Borisov's avatar Nikolay Borisov Committed by David Sterba
Browse files

btrfs: Handle btrfs_set_extent_delalloc failure in relocate_file_extent_cluster



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

Signed-off-by: default avatarNikolay Borisov <nborisov@suse.com>
Reviewed-by: default avatarJosef Bacik <jbacik@fb.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent ac01f26a
Loading
Loading
Loading
Loading
+16 −2
Original line number Original line Diff line number Diff line
@@ -3268,8 +3268,22 @@ static int relocate_file_extent_cluster(struct inode *inode,
			nr++;
			nr++;
		}
		}


		btrfs_set_extent_delalloc(inode, page_start, page_end, 0, NULL,
		ret = btrfs_set_extent_delalloc(inode, page_start, page_end, 0,
					  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);
		set_page_dirty(page);


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