On Wednesday February 27, ross@willow.seitz.com wrote: > Neil, > > I read through the md code this afternoon looking for uses of > mddev->disks, and protected each use with reconfig_sem. These three are > the only three I saw. Thanks. However I think that in each of these cases the semaphore is already held. mddev->reconfig_sem is normally claimed by calling lock_mddev(mddev), which jusdt does down(&mddev->reconfig_sem). The first chunk of yor patch is in bind_rdev_to_array. This is called from autorun_devices which has just allocated the mddev so the semaphore is still locked (it is allocated locked, and then unlocked). add_new_disk and hot_add_disk which are only called from md_ioctl *after* the mddev has been locked with lock_mddev_interruptible(mddev) So in that case the extra locking is not needed and would deadlock. I think you will find that the same is true for the other chunks. NeilBrown - To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html