From b465105a1849cbf893688d4992d602588cc4d5c7 Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Wed, 6 Feb 2019 18:04:25 +0100 Subject: [PATCH] main: fix if shutdown race with writeback --- kernel/sy_old/mars_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/sy_old/mars_main.c b/kernel/sy_old/mars_main.c index 63a1fc1a..7cb8a49a 100644 --- a/kernel/sy_old/mars_main.c +++ b/kernel/sy_old/mars_main.c @@ -4135,8 +4135,10 @@ int make_dev(void *buf, struct mars_dent *dent) switch_on = (rot->if_brick && atomic_read(&rot->if_brick->open_count) > 0) || (rot->todo_primary && + rot->trans_brick && !rot->trans_brick->replay_mode && - rot->trans_brick->power.led_on && + (rot->trans_brick->power.led_on || + (!rot->trans_brick->power.button && !rot->trans_brick->power.led_off)) && _check_allow(global, dent->d_parent, "attach")); if (!global->global_power.button) { switch_on = false;