Like the harddisk, at default write cache is enable. Signed-off-by: Jianpeng Ma <majianpeng@xxxxxxxxx> --- drivers/target/target_core_iblock.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c index b526d23..69c2f2d 100644 --- a/drivers/target/target_core_iblock.c +++ b/drivers/target/target_core_iblock.c @@ -125,6 +125,9 @@ static int iblock_configure_device(struct se_device *dev) dev->dev_attrib.hw_max_sectors = UINT_MAX; dev->dev_attrib.hw_queue_depth = q->nr_requests; + /*Default enable write cache*/ + dev->dev_attrib.emulate_write_cache = 1; + /* * Check if the underlying struct block_device request_queue supports * the QUEUE_FLAG_DISCARD bit for UNMAP/WRITE_SAME in SCSI + TRIM -- 1.7.9.5 ?韬{.n?????%??檩??w?{.n???{炳??Ф?塄}?财??j:+v??????2??璀??摺?囤??z夸z罐?+?????w棹f