mirror of
https://github.com/schoebel/mars
synced 2024-12-26 00:22:31 +00:00
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);
|
||||
status = 0;
|
||||
} else if (!brick->power.led_off) {
|
||||
int flying;
|
||||
|
||||
mars_power_led_on((void*)brick, false);
|
||||
disk = input->disk;
|
||||
if (!disk)
|
||||
@ -818,6 +820,12 @@ static int if_switch(struct if_brick *brick)
|
||||
status = -EBUSY;
|
||||
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) {
|
||||
MARS_DBG("calling bdput()\n");
|
||||
bdput(input->bdev);
|
||||
|
Loading…
Reference in New Issue
Block a user