mirror of https://github.com/schoebel/mars
if: fix early kill of if_brick
This commit is contained in:
parent
9134c1b771
commit
453fcb59d8
|
@ -801,6 +801,8 @@ static int if_switch(struct if_brick *brick)
|
||||||
mars_power_led_on((void*)brick, true);
|
mars_power_led_on((void*)brick, true);
|
||||||
status = 0;
|
status = 0;
|
||||||
} else if (!brick->power.led_off) {
|
} else if (!brick->power.led_off) {
|
||||||
|
int flying;
|
||||||
|
|
||||||
mars_power_led_on((void*)brick, false);
|
mars_power_led_on((void*)brick, false);
|
||||||
disk = input->disk;
|
disk = input->disk;
|
||||||
if (!disk)
|
if (!disk)
|
||||||
|
@ -818,6 +820,12 @@ static int if_switch(struct if_brick *brick)
|
||||||
status = -EBUSY;
|
status = -EBUSY;
|
||||||
goto done; // don't indicate "off" status
|
goto done; // don't indicate "off" status
|
||||||
}
|
}
|
||||||
|
flying = atomic_read(&input->flying_count);
|
||||||
|
if (flying > 0) {
|
||||||
|
MARS_INF("device '%s' has %d flying requests, cannot shutdown\n", disk->disk_name, flying);
|
||||||
|
status = -EBUSY;
|
||||||
|
goto done; // don't indicate "off" status
|
||||||
|
}
|
||||||
if (input->bdev) {
|
if (input->bdev) {
|
||||||
MARS_DBG("calling bdput()\n");
|
MARS_DBG("calling bdput()\n");
|
||||||
bdput(input->bdev);
|
bdput(input->bdev);
|
||||||
|
|
Loading…
Reference in New Issue