aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--block/ioctl.c2
-rw-r--r--fs/block_dev.c7
2 files changed, 8 insertions, 1 deletions
diff --git a/block/ioctl.c b/block/ioctl.c
index e3f5eb9882c..e06dbe9bc85 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -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, 1);
delete_partition(disk, part);
mutex_unlock(&bdev->bd_mutex);
mutex_unlock(&bdevp->bd_mutex);
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 0c59b703e9d..575076c018f 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1101,6 +1101,13 @@ static int __blkdev_get(struct block_device *bdev, mode_t mode, unsigned flags,
int for_part);
static int __blkdev_put(struct block_device *bdev, int for_part);
+/*
+ * bd_mutex locking:
+ *
+ * mutex_lock(part->bd_mutex)
+ * mutex_lock_nested(whole->bd_mutex, 1)
+ */
+
static int do_open(struct block_device *bdev, struct file *file, int for_part)
{
struct module *owner = NULL;