Re: [PATCH 2/7] block: loop: don't hold lo_ctl_mutex in lo_open

2015-04-08 Thread Jarod Wilson
On Wed, Apr 08, 2015 at 10:20:22PM +0800, Ming Lei wrote: > On Wed, Apr 8, 2015 at 10:00 PM, Jarod Wilson wrote: > > On Wed, Apr 08, 2015 at 09:40:34AM -0400, Jarod Wilson wrote: > >> On Wed, Apr 08, 2015 at 02:50:59PM +0800, Ming Lei wrote: > >> > Hi Jarod, > >> > > >> > On Wed, Apr 8, 2015 at 2:

Re: [PATCH 2/7] block: loop: don't hold lo_ctl_mutex in lo_open

2015-04-08 Thread Ming Lei
On Wed, Apr 8, 2015 at 10:00 PM, Jarod Wilson wrote: > On Wed, Apr 08, 2015 at 09:40:34AM -0400, Jarod Wilson wrote: >> On Wed, Apr 08, 2015 at 02:50:59PM +0800, Ming Lei wrote: >> > Hi Jarod, >> > >> > On Wed, Apr 8, 2015 at 2:23 PM, Jarod Wilson wrote: >> > > From: Ming Lei >> > > >> > > The l

Re: [PATCH 2/7] block: loop: don't hold lo_ctl_mutex in lo_open

2015-04-08 Thread Jarod Wilson
On Wed, Apr 08, 2015 at 09:40:34AM -0400, Jarod Wilson wrote: > On Wed, Apr 08, 2015 at 02:50:59PM +0800, Ming Lei wrote: > > Hi Jarod, > > > > On Wed, Apr 8, 2015 at 2:23 PM, Jarod Wilson wrote: > > > From: Ming Lei > > > > > > The lo_ctl_mutex is held for running all ioctl handlers, and > > >

Re: [PATCH 2/7] block: loop: don't hold lo_ctl_mutex in lo_open

2015-04-08 Thread Jarod Wilson
On Wed, Apr 08, 2015 at 02:50:59PM +0800, Ming Lei wrote: > Hi Jarod, > > On Wed, Apr 8, 2015 at 2:23 PM, Jarod Wilson wrote: > > From: Ming Lei > > > > The lo_ctl_mutex is held for running all ioctl handlers, and > > in some ioctl handlers, ioctl_by_bdev(BLKRRPART) is called for > > rereading p

Re: [PATCH 2/7] block: loop: don't hold lo_ctl_mutex in lo_open

2015-04-07 Thread Ming Lei
Hi Jarod, On Wed, Apr 8, 2015 at 2:23 PM, Jarod Wilson wrote: > From: Ming Lei > > The lo_ctl_mutex is held for running all ioctl handlers, and > in some ioctl handlers, ioctl_by_bdev(BLKRRPART) is called for > rereading partitions, which requires bd_mutex. > > So it is easy to cause failure bec

[PATCH 2/7] block: loop: don't hold lo_ctl_mutex in lo_open

2015-04-07 Thread Jarod Wilson
From: Ming Lei The lo_ctl_mutex is held for running all ioctl handlers, and in some ioctl handlers, ioctl_by_bdev(BLKRRPART) is called for rereading partitions, which requires bd_mutex. So it is easy to cause failure because trylock(bd_mutex) may fail inside blkdev_reread_part(), and follows the