Thread (9 messages) 9 messages, 4 authors, 2022-02-11

Re: [PATCH 2/5] memstick/ms_block: simplify refcounting

From: Ming Lei <hidden>
Date: 2022-02-11 02:36:13
Also in: linux-mmc, virtualization

On Wed, Feb 09, 2022 at 09:21:17AM +0100, Christoph Hellwig wrote:
Implement the ->free_disk method to free the msb_data structure only once
the last gendisk reference goes away instead of keeping a local refcount.
The approach looks good, just the error handling needs to be careful,
such as, once driver data is bound to disk->private_data, the previous
error handling code shouldn't touch/free the driver data any more. That
said assigning disk->private_data implies driver data ownership transfer
after this conversion.

Such as, in msb_init_disk(), once blk_cleanup_disk() is done, the code
branch of out_release_id shouldn't be run; msb_probe() has the similar
issue too.

Thanks,
Ming
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help