Re: [PATCH] block: protect iterate_bdevs() against concurrent close

2016-03-15 Thread Jan Kara
On Mon 14-03-16 18:42:58, Rabin Vincent wrote: > (fixed Jens' address) > > On Thu, Mar 10, 2016 at 06:37:27PM +0100, Jan Kara wrote: > > On Thu 10-03-16 13:26:03, Rabin Vincent wrote: > > > If a block device is closed while iterate_bdevs() is handling it, the > > > following NULL pointer dereferen

Re: [PATCH] block: protect iterate_bdevs() against concurrent close

2016-03-15 Thread Christoph Hellwig
On Thu, Mar 10, 2016 at 06:37:27PM +0100, Jan Kara wrote: > Thanks for spotting the problem. The patch will fix the problem you found. > But what prevents e.g. flusher thread from trying to writeback the block > device inode while that gets invalidated at the same moment? I.e., the > problem doesn'

Re: [PATCH] block: protect iterate_bdevs() against concurrent close

2016-03-14 Thread Rabin Vincent
(fixed Jens' address) On Thu, Mar 10, 2016 at 06:37:27PM +0100, Jan Kara wrote: > On Thu 10-03-16 13:26:03, Rabin Vincent wrote: > > If a block device is closed while iterate_bdevs() is handling it, the > > following NULL pointer dereference occurs because bdev->b_disk is NULL > > in bdev_get_queu

Re: [PATCH] block: protect iterate_bdevs() against concurrent close

2016-03-10 Thread Jan Kara
On Thu 10-03-16 13:26:03, Rabin Vincent wrote: > From: Rabin Vincent > > If a block device is closed while iterate_bdevs() is handling it, the > following NULL pointer dereference occurs because bdev->b_disk is NULL > in bdev_get_queue(), which is called from blk_get_backing_dev_info() (in > turn