Re: [PATCH] bcache: untagle cache_aolloc

Kent Overstreet
2016-07-18T10:29:03Z

On Mon, Jul 18, 2016 at 12:24:11PM +0200, Johannes Thumshirn wrote:
> On Mon, Jul 18, 2016 at 02:13:33AM -0800, Kent Overstreet wrote:
> > On Mon, Jul 18, 2016 at 12:11:09PM +0200, Johannes Thumshirn wrote:
> > > bcache's cache_alloc() function currenty has no way freeing memory if one of
> > > the allocations fails. Untangle the if + allocation statement so we have
> > > defined checkpoints to free previous allocations if one fails.
> >
> > nack. The existing error path handles failure midway through just fine.
>
> Come on, the patch improves the readability of the if statement by some orders
> of magnitude as well.
>
> Are you OK with it if I change the subject/commit log?

No, it's just churn and I don't agree that it improves readability. On the
contrary, now the cleanup code has to be duplicated in two places - which
invites them getting out of sync and introducing bugs.