On 11 Dec 2019, at 19:07, Dennis Zhou wrote:
> Compressed writes happen in the background via kworkers. However, this
> causes bios to be attributed to root bypassing any cgroup limits from
> the actual writer. We tag the first bio with REQ_CGROUP_PUNT, which
> will
> punt the bio to an appropriate cgroup specific workqueue and attribute
> the IO properly. However, if btrfs_submit_compressed_write() creates a
> new bio, we don't tag it the same way. Add the appropriate tagging for
> subsequent bios.
>
> Fixes: ec39f7696ccfa ("Btrfs: use REQ_CGROUP_PUNT for worker thread
> submitted bios")
> Cc: Chris Mason <clm@xxxxxx>
> Signed-off-by: Dennis Zhou <dennis@xxxxxxxxxx>
Good catch Dennis. The compression code should end up limiting the size
of the bio such that we'll never actually fail to bio_add_page(), but
this is still the right thing to do.
Reviewed-by: Chris Mason <clm@xxxxxx>
-chris