X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=drivers%2Ftarget%2Ftarget_core_device.c;h=2be407e22eb499902bd2320e976b0c178fe4bfd3;hb=cc43a17507644ad34d07a3e95d7376d55fd82b15;hp=660b109487ae36f65d21804f18b16f0ca7cd4351;hpb=31c39ee311f03cc286a9b3d397eb92c050407cf0;p=firefly-linux-kernel-4.4.55.git diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c index 660b109487ae..2be407e22eb4 100644 --- a/drivers/target/target_core_device.c +++ b/drivers/target/target_core_device.c @@ -614,6 +614,7 @@ void core_dev_unexport( dev->export_count--; spin_unlock(&hba->device_lock); + lun->lun_sep = NULL; lun->lun_se_dev = NULL; } @@ -796,10 +797,10 @@ int se_dev_set_emulate_write_cache(struct se_device *dev, int flag) pr_err("emulate_write_cache not supported for pSCSI\n"); return -EINVAL; } - if (dev->transport->get_write_cache) { - pr_warn("emulate_write_cache cannot be changed when underlying" - " HW reports WriteCacheEnabled, ignoring request\n"); - return 0; + if (flag && + dev->transport->get_write_cache) { + pr_err("emulate_write_cache not supported for this device\n"); + return -EINVAL; } dev->dev_attrib.emulate_write_cache = flag; @@ -1292,7 +1293,8 @@ int core_dev_add_initiator_node_lun_acl( * Check to see if there are any existing persistent reservation APTPL * pre-registrations that need to be enabled for this LUN ACL.. */ - core_scsi3_check_aptpl_registration(lun->lun_se_dev, tpg, lun, lacl); + core_scsi3_check_aptpl_registration(lun->lun_se_dev, tpg, lun, nacl, + lacl->mapped_lun); return 0; }