Re: [PATCH 1/7] block: export blkdev_reread_part() and __blkdev_reread_part()

2015-04-08 Thread Jarod Wilson
On Wed, Apr 08, 2015 at 05:03:25PM +0200, Peter Zijlstra wrote: > On Wed, Apr 08, 2015 at 10:50:56PM +0800, Ming Lei wrote: > > > +/* > > > + * This is an exported API for the block driver, and will not > > > + * acquire bd_mutex, leaving it up to the caller to handle > > > + * any necessary lockin

Re: [PATCH 1/7] block: export blkdev_reread_part() and __blkdev_reread_part()

2015-04-08 Thread Ming Lei
On Wed, Apr 8, 2015 at 11:03 PM, Peter Zijlstra wrote: > On Wed, Apr 08, 2015 at 10:50:56PM +0800, Ming Lei wrote: >> > +/* >> > + * This is an exported API for the block driver, and will not >> > + * acquire bd_mutex, leaving it up to the caller to handle >> > + * any necessary locking. >> >> Act

Re: [PATCH 1/7] block: export blkdev_reread_part() and __blkdev_reread_part()

2015-04-08 Thread Peter Zijlstra
On Wed, Apr 08, 2015 at 10:50:56PM +0800, Ming Lei wrote: > > +/* > > + * This is an exported API for the block driver, and will not > > + * acquire bd_mutex, leaving it up to the caller to handle > > + * any necessary locking. > > Actually, the function is introduced and should be used in case >

Re: [PATCH 1/7] block: export blkdev_reread_part() and __blkdev_reread_part()

2015-04-08 Thread Ming Lei
On Wed, Apr 8, 2015 at 2:23 PM, Jarod Wilson wrote: > This patch exports blkdev_reread_part() for block drivers, also > introduce __blkdev_reread_part(), a lockless version. Generally the term of lockless is used when lock is avoided, and that isn't the case of __blkdev_reread_part(), because bd_

[PATCH 1/7] block: export blkdev_reread_part() and __blkdev_reread_part()

2015-04-07 Thread Jarod Wilson
This patch exports blkdev_reread_part() for block drivers, also introduce __blkdev_reread_part(), a lockless version. For some drivers, such as loop, a reread of partitions can be run from the release path, and bd_mutex may already be held prior to calling ioctl_by_bdev(bdev, BLKRRPART, 0), so int