The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] block_dev.c mutex_lock_nested() fix
@ 2006-08-23 15:09 Jason Baron
  2006-08-23 16:48 ` Peter Zijlstra
  2006-08-23 18:02 ` Andrew Morton
  0 siblings, 2 replies; 4+ messages in thread
From: Jason Baron @ 2006-08-23 15:09 UTC (permalink / raw)
  To: neilb; +Cc: akpm, arjan, mingo, axboe, a.p.zijlstra, linux-kernel


Hi,

In the case below we are locking the whole disk not a partition. This 
change simply brings the code in line with the piece above where when we 
are the 'first' opener, and we are a partition.

thanks,

-Jason

Signed-off-by: Jason Baron <jbaron@redhat.com>

--- linux-2.6/fs/block_dev.c.bak
+++ linux-2.6/fs/block_dev.c
@@ -966,7 +966,7 @@ do_open(struct block_device *bdev, struc
 				rescan_partitions(bdev->bd_disk, bdev);
 		} else {
 			mutex_lock_nested(&bdev->bd_contains->bd_mutex,
-					  BD_MUTEX_PARTITION);
+					  BD_MUTEX_WHOLE);
 			bdev->bd_contains->bd_part_count++;
 			mutex_unlock(&bdev->bd_contains->bd_mutex);
 		}

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] block_dev.c mutex_lock_nested() fix
  2006-08-23 15:09 [PATCH] block_dev.c mutex_lock_nested() fix Jason Baron
@ 2006-08-23 16:48 ` Peter Zijlstra
  2006-08-23 18:02 ` Andrew Morton
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Zijlstra @ 2006-08-23 16:48 UTC (permalink / raw)
  To: Jason Baron; +Cc: neilb, akpm, arjan, mingo, axboe, linux-kernel

On Wed, 2006-08-23 at 11:09 -0400, Jason Baron wrote:
> Hi,
> 
> In the case below we are locking the whole disk not a partition. This 
> change simply brings the code in line with the piece above where when we 
> are the 'first' opener, and we are a partition.

Makes sense in that only whole devices have a partition count.

> Signed-off-by: Jason Baron <jbaron@redhat.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>

> --- linux-2.6/fs/block_dev.c.bak
> +++ linux-2.6/fs/block_dev.c
> @@ -966,7 +966,7 @@ do_open(struct block_device *bdev, struc
>  				rescan_partitions(bdev->bd_disk, bdev);
>  		} else {
>  			mutex_lock_nested(&bdev->bd_contains->bd_mutex,
> -					  BD_MUTEX_PARTITION);
> +					  BD_MUTEX_WHOLE);
>  			bdev->bd_contains->bd_part_count++;
>  			mutex_unlock(&bdev->bd_contains->bd_mutex);
>  		}


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] block_dev.c mutex_lock_nested() fix
  2006-08-23 18:02 ` Andrew Morton
@ 2006-08-23 17:51   ` Jason Baron
  0 siblings, 0 replies; 4+ messages in thread
From: Jason Baron @ 2006-08-23 17:51 UTC (permalink / raw)
  To: Andrew Morton; +Cc: neilb, arjan, mingo, axboe, a.p.zijlstra, linux-kernel


On Wed, 23 Aug 2006, Andrew Morton wrote:

> On Wed, 23 Aug 2006 11:09:35 -0400 (EDT)
> Jason Baron <jbaron@redhat.com> wrote:
> 
> > 
> > Hi,
> > 
> > In the case below we are locking the whole disk not a partition. This 
> > change simply brings the code in line with the piece above where when we 
> > are the 'first' opener, and we are a partition.
> > 
> > thanks,
> > 
> > -Jason
> > 
> > Signed-off-by: Jason Baron <jbaron@redhat.com>
> > 
> > --- linux-2.6/fs/block_dev.c.bak
> > +++ linux-2.6/fs/block_dev.c
> > @@ -966,7 +966,7 @@ do_open(struct block_device *bdev, struc
> >  				rescan_partitions(bdev->bd_disk, bdev);
> >  		} else {
> >  			mutex_lock_nested(&bdev->bd_contains->bd_mutex,
> > -					  BD_MUTEX_PARTITION);
> > +					  BD_MUTEX_WHOLE);
> >  			bdev->bd_contains->bd_part_count++;
> >  			mutex_unlock(&bdev->bd_contains->bd_mutex);
> >  		}
> 
> This was allegedly (re-re-re-re-)fixed in 2.6.18-rc4-mm2. 
> lockdep-fix-blkdev_open-warning.patch and
> lockdep-fix-blkdev_open-warning-fix.patch.
> 
> Is this patch needed in that kernel?
> 

yes. Those patches address a similar type of issue, but not this specific 
one. 



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] block_dev.c mutex_lock_nested() fix
  2006-08-23 15:09 [PATCH] block_dev.c mutex_lock_nested() fix Jason Baron
  2006-08-23 16:48 ` Peter Zijlstra
@ 2006-08-23 18:02 ` Andrew Morton
  2006-08-23 17:51   ` Jason Baron
  1 sibling, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2006-08-23 18:02 UTC (permalink / raw)
  To: Jason Baron; +Cc: neilb, arjan, mingo, axboe, a.p.zijlstra, linux-kernel

On Wed, 23 Aug 2006 11:09:35 -0400 (EDT)
Jason Baron <jbaron@redhat.com> wrote:

> 
> Hi,
> 
> In the case below we are locking the whole disk not a partition. This 
> change simply brings the code in line with the piece above where when we 
> are the 'first' opener, and we are a partition.
> 
> thanks,
> 
> -Jason
> 
> Signed-off-by: Jason Baron <jbaron@redhat.com>
> 
> --- linux-2.6/fs/block_dev.c.bak
> +++ linux-2.6/fs/block_dev.c
> @@ -966,7 +966,7 @@ do_open(struct block_device *bdev, struc
>  				rescan_partitions(bdev->bd_disk, bdev);
>  		} else {
>  			mutex_lock_nested(&bdev->bd_contains->bd_mutex,
> -					  BD_MUTEX_PARTITION);
> +					  BD_MUTEX_WHOLE);
>  			bdev->bd_contains->bd_part_count++;
>  			mutex_unlock(&bdev->bd_contains->bd_mutex);
>  		}

This was allegedly (re-re-re-re-)fixed in 2.6.18-rc4-mm2. 
lockdep-fix-blkdev_open-warning.patch and
lockdep-fix-blkdev_open-warning-fix.patch.

Is this patch needed in that kernel?


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-08-23 18:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-23 15:09 [PATCH] block_dev.c mutex_lock_nested() fix Jason Baron
2006-08-23 16:48 ` Peter Zijlstra
2006-08-23 18:02 ` Andrew Morton
2006-08-23 17:51   ` Jason Baron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox