Re: [PATCH 2/2] btrfs: more trivial BTRFS_PATH_AUTO_FREE conversions

Sun YangKai
2025-08-22T15:51:25Z

> Please split the patch to parts that have the described trivial changes,
> and then one patch per function in case it's not trivial and needs some
> adjustments.
>

After learning more about the auto-free/cleanup mechanism, I realized that its
only advantage is to eliminate the need for the goto out; pattern. Therefore,
it seems unnecessary to apply this conversion in non-trivial cases.

Moreover, if the cleanup code contains other logic, it might be better to
leave it unchanged even in trivial cases.

> The freeing followed by other code can be still converted to auto
> cleaning but there must be an explicit path = NULL after the free.

I'm sorry, I didn't understand. If the freeing is followed by other code,
maybe we could just leave them untouched?

Please let me know if I've got anything wrong.

Best regards,
Sun Yangkai