lkml.org 
[lkml]   [2015]   [Apr]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv3 9/9] zram: add dynamic device add/remove functionality
On (04/29/15 16:02), Sergey Senozhatsky wrote:
> sure. I was talking about this one:
>
> CPU0 CPU1
> umount
> zram_remove()
> lock ->bd_mutex
> zram_reset_device()
> unlock ->bd_mutex
> disksize_store
> mount
> echo 'test' > /mnt/test
> kfree zram
> zram write
>

I'll take a look later today. currently I think of something like:


sysfs_remove_group()
lock ->bd_mutex
... check ->bd_openers

zram_reset_device()
blk_cleanup_queue()
del_gendisk()
put_disk()

unlock ->bd_mutex
bdput bdev

idr_remove()
kfree(zram)


iow, idr_remove() and kfree() are done outside of ->bd_mutex lock.
but I may be wrong. haven't tested yet. but seems reasonable: we
invalidate ->bdev, delete partitions, etc., holding ->bd_mutex and
then release ->bdev, which does final put. need to check that in
detail.

-ss


\
 
 \ /
  Last update: 2015-04-29 09:41    [W:0.172 / U:0.688 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site