Re: [PATCH 5/9] btrfs: remove trivial goto label in __extent_writepage()

Johannes Thumshirn
2019-12-03T13:06:24Z

On Mon, Dec 02, 2019 at 05:34:21PM -0800, Omar Sandoval wrote:
[...]
> diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
> index dad6b06d0a8e..8622282db31e 100644
> --- a/fs/btrfs/extent_io.c
> +++ b/fs/btrfs/extent_io.c
> @@ -3596,7 +3596,7 @@ static int __extent_writepage(struct page *page, struct writeback_control *wbc,
> if (!epd->extent_locked) {
> ret = writepage_delalloc(inode, page, wbc, start, &nr_written);
> if (ret == 1)
> - goto done_unlocked;
> + return 0;
> if (ret)
> goto done;

Unrelated side note, wouldn't it be more obvious if we do
if (ret == 1)
return 0;
if (ret < 0)
goto done;
as writepage_delalloc() returns 1, 0, and < 1

Anyways this is not really related to this patch,
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>