# Re: \[PATCH v2 3/3\] blk-cgroup: move async bio punt state to blkcg

- From: Christoph Hellwig \<hch@lst.de\>
- Date: 2026-09-15 06:50:49 
- List: linux-raid
- Page: https://ratatoskr.run/linux-raid/2026/09/17577508
- Thread: https://ratatoskr.run/linux-block/2026/09/17568303/t.md

```text
On Sun, Sep 13, 2026 at 06:59:25PM +0530, Nilay Shroff wrote:
>> +	/* as long as there are pending bios, @blkcg can't go away */
>> +	{
>> +		guard(spinlock)(&blkcg->async_bio_lock);
>> +		bio_list_merge_init(&bios, &blkcg->async_bios);
>> +	}
>>
> Instead of using guard(spinlock)(...) here, I think we could use the
> simpler spin_lock()/spin_unlock() helpers. IMO, they are easier
> to read and reason about for these short critical sections.

Yes, guard() is a complete mess that makes code unreadable, please
don't use it.  scope_guard is a bit better, but given that it doesn't
mix with goto based unwdinding it still is too dangerous to actually
use.

```
