aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2010-08-06 21:01:59 -0400
committerNeilBrown <neilb@suse.de>2010-08-08 07:20:17 -0400
commit147e0b6a639ac581ca3bf627bedc3f4a6d3eca66 (patch)
tree95ca7cb3b2f06586d678ec33c0e9910d11f3af42
parent51e9ac77035a3dfcb6fc0a88a0d80b6f99b5edb1 (diff)
md: move revalidate_disk() back outside open_mutex
Commit b821eaa5 "md: remove ->changed and related code" moved revalidate_disk() under open_mutex, and lockdep noticed. [ INFO: possible circular locking dependency detected ] 2.6.32-mdadm-locking #1 ------------------------------------------------------- mdadm/3640 is trying to acquire lock: (&bdev->bd_mutex){+.+.+.}, at: [<ffffffff811acecb>] revalidate_disk+0x5b/0x90 but task is already holding lock: (&mddev->open_mutex){+.+...}, at: [<ffffffffa055e07a>] do_md_stop+0x4a/0x4d0 [md_mod] which lock already depends on the new lock. It is suitable for 2.6.35.x Cc: <stable@kernel.org> Reported-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r--drivers/md/md.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 40b7ca0294ac..00c3fde39a12 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -4765,7 +4765,7 @@ out:
4765 */ 4765 */
4766static int do_md_stop(mddev_t * mddev, int mode, int is_open) 4766static int do_md_stop(mddev_t * mddev, int mode, int is_open)
4767{ 4767{
4768 int err = 0; 4768 int err = 0, revalidate = 0;
4769 struct gendisk *disk = mddev->gendisk; 4769 struct gendisk *disk = mddev->gendisk;
4770 mdk_rdev_t *rdev; 4770 mdk_rdev_t *rdev;
4771 4771
@@ -4795,7 +4795,7 @@ static int do_md_stop(mddev_t * mddev, int mode, int is_open)
4795 } 4795 }
4796 4796
4797 set_capacity(disk, 0); 4797 set_capacity(disk, 0);
4798 revalidate_disk(disk); 4798 revalidate = 1;
4799 4799
4800 if (mddev->ro) 4800 if (mddev->ro)
4801 mddev->ro = 0; 4801 mddev->ro = 0;
@@ -4803,6 +4803,8 @@ static int do_md_stop(mddev_t * mddev, int mode, int is_open)
4803 err = 0; 4803 err = 0;
4804 } 4804 }
4805 mutex_unlock(&mddev->open_mutex); 4805 mutex_unlock(&mddev->open_mutex);
4806 if (revalidate)
4807 revalidate_disk(disk);
4806 if (err) 4808 if (err)
4807 return err; 4809 return err;
4808 /* 4810 /*