]> git.itanic.dy.fi Git - linux-stable/commitdiff
s390/dasd: add missing KOBJ_CHANGE event for unformatted devices
authorStefan Haberland <sth@linux.vnet.ibm.com>
Wed, 31 Aug 2016 11:31:10 +0000 (13:31 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 20 Sep 2016 12:26:29 +0000 (14:26 +0200)
The DASD device driver throws change events for the DASD blockdevice
after the online processing is done so that udev rules can take
actions after it.
The change event was missing for unformatted devices.

Signed-off-by: Stefan Haberland <sth@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/block/dasd.c

index fb1b56a714753f208c29511c9cc6cea0550daffd..5245d7e37a46bbbb5b03c28d59a85dfdfa861f4f 100644 (file)
@@ -336,6 +336,7 @@ static int dasd_state_basic_to_ready(struct dasd_device *device)
 {
        int rc;
        struct dasd_block *block;
+       struct gendisk *disk;
 
        rc = 0;
        block = device->block;
@@ -346,6 +347,9 @@ static int dasd_state_basic_to_ready(struct dasd_device *device)
                if (rc) {
                        if (rc != -EAGAIN) {
                                device->state = DASD_STATE_UNFMT;
+                               disk = device->block->gdp;
+                               kobject_uevent(&disk_to_dev(disk)->kobj,
+                                              KOBJ_CHANGE);
                                goto out;
                        }
                        return rc;