Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ddca60c5 authored by Arjan van de Ven's avatar Arjan van de Ven Committed by Linus Torvalds
Browse files

[PATCH] lockdep: annotate the BLKPG_DEL_PARTITION ioctl



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: default avatarArjan van de Ven <arjan@linux.intel.com>
Acked-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 7e56a7dc
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -72,7 +72,7 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user
			bdevp = bdget_disk(disk, part);
			bdevp = bdget_disk(disk, part);
			if (!bdevp)
			if (!bdevp)
				return -ENOMEM;
				return -ENOMEM;
			mutex_lock(&bdevp->bd_mutex);
			mutex_lock_nested(&bdevp->bd_mutex, BD_MUTEX_PARTITION);
			if (bdevp->bd_openers) {
			if (bdevp->bd_openers) {
				mutex_unlock(&bdevp->bd_mutex);
				mutex_unlock(&bdevp->bd_mutex);
				bdput(bdevp);
				bdput(bdevp);
@@ -82,7 +82,7 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user
			fsync_bdev(bdevp);
			fsync_bdev(bdevp);
			invalidate_bdev(bdevp, 0);
			invalidate_bdev(bdevp, 0);


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