Re: [PATCH v3 15/26] btrfs: refactor submit_compressed_extents()
From: David Sterba <hidden>
Date: 2021-10-05 16:33:53
From: David Sterba <hidden>
Date: 2021-10-05 16:33:53
On Mon, Sep 27, 2021 at 03:21:57PM +0800, Qu Wenruo wrote:
We have a big hunk of code inside a while() loop, with tons of strange jump for error handling. It's definitely not to the code standard of today. Move the code into a new function, submit_one_async_extent(). Since we're here, also do the following modifications: - Comment style change To follow the current scheme - Don't fallback to non-compressed write then hitting ENOSPC If we hit ENOSPC for compressed write, how could we reserve more space for non-compressed write? Thus we go error path directly. This removes the retry: label.
I'm not happy about mixing this change with a refactoring, as it's a functional change and in the logic how compressed writes do the fallback. This should have proper reasoning and some kind of independent testing. As it does not sound wrong I'll leave as it is, hopefully this won't haunt us in the future.