Skip to content

Commit 2a3d84f

Browse files
lorddoskiasgregkh
authored andcommitted
btrfs: Move free_pages_out label in inline extent handling branch in compress_file_range
[ Upstream commit cecc8d9 ] This label is only executed if compress_file_range fails to create an inline extent. So move its code in the semantically related inline extent handling branch. No functional changes. Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent f50a0ab commit 2a3d84f

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

fs/btrfs/inode.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,14 @@ static noinline void compress_file_range(struct inode *inode,
628628
PAGE_SET_WRITEBACK |
629629
page_error_op |
630630
PAGE_END_WRITEBACK);
631-
goto free_pages_out;
631+
632+
for (i = 0; i < nr_pages; i++) {
633+
WARN_ON(pages[i]->mapping);
634+
put_page(pages[i]);
635+
}
636+
kfree(pages);
637+
638+
return;
632639
}
633640
}
634641

@@ -706,13 +713,6 @@ static noinline void compress_file_range(struct inode *inode,
706713
*num_added += 1;
707714

708715
return;
709-
710-
free_pages_out:
711-
for (i = 0; i < nr_pages; i++) {
712-
WARN_ON(pages[i]->mapping);
713-
put_page(pages[i]);
714-
}
715-
kfree(pages);
716716
}
717717

718718
static void free_async_extent_pages(struct async_extent *async_extent)

0 commit comments

Comments
 (0)