Re: [PATCH BUGFIX] block: add missing group association in bio_split

Jens Axboe
2016-05-09T14:55:24Z

On 05/09/2016 08:39 AM, Paolo wrote:
> Il 09/05/2016 16:35, Jeff Moyer ha scritto:
>> Jeff Moyer <jmoyer@redhat.com> writes:
>>
>>> Paolo Valente <paolo.valente@linaro.org> writes:
>>>
>>>> @@ -1811,6 +1811,11 @@ struct bio *bio_split(struct bio *bio, int
>>>> sectors,
>>>>
>>>> bio_advance(bio, split->bi_iter.bi_size);
>>>>
>>>> +#ifdef CONFIG_BLK_CGROUP
>>>> + if (bio->bi_css)
>>>> + bio_associate_blkcg(split, bio->bi_css);
>>>> +#endif
>>>> +
>>>> return split;
>>>> }
>>>> EXPORT_SYMBOL(bio_split);
>>>
>>> Get rid of the #ifdefery. This should be just:
>>>
>>> bio_associate_blkcg(split, bio->bi_css);
>>
>> Gah, I see that the bi_css member is only present for CONFIG_BLK_CGROUP.
>> I guess we'll have to live with the ifdef.
>>
>
> We have already tried to remove it, but it seems it would require other
> major changes.

It'd be cleaner to have a

bio_clone_associate_blkcg(split, bio);

or similar, and then hide it in there.

--
Jens Axboe