Skip to content

Commit

Permalink
[PATCH] lockdep: annotate the BLKPG_DEL_PARTITION ioctl
Browse files Browse the repository at this point in the history
The delete partition IOCTL takes the bd_mutex for both the disk and the
partition; these have an obvious hierarchical relationship and this patch
annotates this relationship for lockdep.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
fenrus75 authored and Linus Torvalds committed Jul 15, 2006
1 parent 7e56a7d commit ddca60c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions block/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user
bdevp = bdget_disk(disk, part);
if (!bdevp)
return -ENOMEM;
mutex_lock(&bdevp->bd_mutex);
mutex_lock_nested(&bdevp->bd_mutex, BD_MUTEX_PARTITION);
if (bdevp->bd_openers) {
mutex_unlock(&bdevp->bd_mutex);
bdput(bdevp);
Expand All @@ -82,7 +82,7 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user
fsync_bdev(bdevp);
invalidate_bdev(bdevp, 0);

mutex_lock(&bdev->bd_mutex);
mutex_lock_nested(&bdev->bd_mutex, BD_MUTEX_WHOLE);
delete_partition(disk, part);
mutex_unlock(&bdev->bd_mutex);
mutex_unlock(&bdevp->bd_mutex);
Expand Down

0 comments on commit ddca60c

Please sign in to comment.