[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150429070218.GA616@swordfish>
Date: Wed, 29 Apr 2015 16:02:18 +0900
From: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
To: Minchan Kim <minchan@...nel.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Nitin Gupta <ngupta@...are.org>, linux-kernel@...r.kernel.org,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>
Subject: Re: [PATCHv3 9/9] zram: add dynamic device add/remove functionality
Hello Minchan,
On (04/29/15 15:48), Minchan Kim wrote:
[..]
> >
> > CPU0 CPU1
> > umount
> > zram_remove()
> > zram_reset_device() disksize_store()
> > mount
> > kfree zram
> >
> > or
> >
> > CPU0 CPU1
> > umount
> > zram_remove()
> > zram_reset_device()
> > cat /sys/block/zram0/_any_sysfs_node_
> > sysfs_remove_group()
> > kfree zram _any_sysfs_node_read()
> >
> >
> > and so on. so removing sysfs group before zram_reset_device() makes sense.
> >
> > at the same time we need to prevent `umount-zram_remove vs. mount' race and forbid
> > zram_remove() on active device. so we check ->bd_openers and perform device reset
> > under ->bd_mutex.
> >
>
> Could you explain in detail about unmount-zram_remove vs. mount race?
> I guess it should be done in upper layer(e,g. VFS). Anyway, I want to be
> more clear about that.
>
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
w/o ->bd_mutex around zram_reset_device() it's evern simpler, I guess.
hm, I don't think VFS can help us here.
-ss
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists