Re: [PATCH v3] rust: block: set GenDisk block_device_operations.owner to THIS_MODULE
From: Andreas Hindborg
Date: Wed Sep 23 2026 - 16:55:19 EST
Andreas Hindborg <a.hindborg@xxxxxxxxxx> writes:
> Hi Adarsh,
>
> Adarsh Das <adarshdas950@xxxxxxxxx> writes:
>
>> GenDiskBuilder left block_device_operations.owner NULL. Set owner from a
>> const block_device_operations table using this_module::<M>() and update
>> rnull to pass NullBlkModule.
>>
>> Add ModuleMetadata::THIS_MODULE and this_module() so the owner pointer is
>> available in const context. Rebased on Alvins fix-fops-owner series [1].
>>
>> Link: https://lore.kernel.org/all/20260805192020.107601-1-adarshdas950@xxxxxxxxx/
>>
>
> We merged `LocalModule` [1]. Please use this feature to set the owner.
>
> I don't think you need to move the operations vtable.
>
> Best regards,
> Andreas Hindborg
>
> [1] https://lore.kernel.org/r/20260811-fix-fops-owner-v10-7-7e71776f9dbe@xxxxxxxxx
Actually we are going to pick this one instead [1]. Seems like you have
been trying to do the same thing.
Best regards,
Andreas Hindborg
[1] https://lore.kernel.org/r/20260811-fix-gendisk-owner-v1-1-c0fe4a449ecb@xxxxxxxxx