# Re: move the bdi from the request\_queue to the gendisk

- From: Qian Cai \<hidden\>
- Date: 2021-08-11 02:28:17 
- List: linux-mm
- Page: https://ratatoskr.run/linux-mm/2021/08/212056
- Thread: https://ratatoskr.run/linux-block/2021/08/211860/t.md

```text


On 8/10/2021 4:02 PM, Christoph Hellwig wrote:
> On Tue, Aug 10, 2021 at 03:36:39PM -0400, Qian Cai wrote:
>>
>>
>> On 8/9/2021 10:17 AM, Christoph Hellwig wrote:
>>> Hi Jens,
>>>
>>> this series moves the pointer to the bdi from the request_queue
>>> to the bdi, better matching the life time rules of the different
>>> objects.
>>
>> Reverting this series fixed an use-after-free in bdev_evict_inode().
> 
> Please try the patch below as a band-aid.  Although the proper fix is
> that non-default bdi_writeback structures grab a reference to the bdi,
> as this was a landmine that might have already caused spurious issues
> before.

This works fine with a quick test.

```
