Hi majianpeng, On Fri, 2013-01-25 at 09:58 +0800, majianpeng wrote: > 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; > + So enabling emulate_write_cache=1 in the case when the underlying device has not enabled it is incorrect. I'd like to enable this bit when we know the underlying device has WCE=1 set, but currently there is not a way to determine this (generically) from struct block_device. So NACK for applying this until there is a method to determine what the hardware below is doing. --nab > /* > * 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 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html