diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 1db5ed914..c2771ace5 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -4234,7 +4234,7 @@ void scst_free_device(struct scst_device *dev) #endif /* Ensure that ext_blockers_work is done */ - flush_scheduled_work(); + flush_work(&dev->ext_blockers_work); scst_deinit_threads(&dev->dev_cmd_threads); diff --git a/scst/src/scst_sysfs.c b/scst/src/scst_sysfs.c index e9eeead3e..103ff8a3b 100644 --- a/scst/src/scst_sysfs.c +++ b/scst/src/scst_sysfs.c @@ -1432,14 +1432,14 @@ static int __scst_process_luns_mgmt_store(char *buffer, } case SCST_LUN_ACTION_REPLACE: { - unsigned int flags = (read_only ? SCST_ADD_LUN_READ_ONLY : 0) | - (replace_gen_ua ? SCST_REPL_LUN_GEN_UA : 0); + unsigned int flags = replace_gen_ua ? SCST_REPL_LUN_GEN_UA : 0; res = scst_parse_add_repl_param(acg, dev, pp, &virt_lun, &read_only); if (res != 0) goto out_unlock; + flags |= read_only ? SCST_ADD_LUN_READ_ONLY : 0; res = scst_acg_repl_lun(acg, tgt_kobj ? tgt->tgt_luns_kobj : acg->luns_kobj, dev, virt_lun, flags);