Skip to content

Commit

Permalink
[S390] cio: Fix ungroup vs. machine check race in ccwgroup.
Browse files Browse the repository at this point in the history
There are two ways for a ccwgroup device to be unregistered:
Via the ungroup attribute, or when on of the slave devices is killed
by a machine check. As we have to unregister the ccwgroup device
via a callback, we'll now have to check whether it hasn't been
already unregistered because of a machine check.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Cornelia Huck authored and Martin Schwidefsky committed Jan 26, 2008
1 parent 46258ab commit 1a908c7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/s390/cio/ccwgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ static void ccwgroup_ungroup_callback(struct device *dev)
struct ccwgroup_device *gdev = to_ccwgroupdev(dev);

mutex_lock(&gdev->reg_mutex);
__ccwgroup_remove_symlinks(gdev);
device_unregister(dev);
if (device_is_registered(&gdev->dev)) {
__ccwgroup_remove_symlinks(gdev);
device_unregister(dev);
}
mutex_unlock(&gdev->reg_mutex);
}

Expand Down

0 comments on commit 1a908c7

Please sign in to comment.