Re: [PATCH] sd: make ->no_write_same independent of reported ->max_ws_blocks

From: Martin K. Petersen
Date: Mon Dec 05 2016 - 22:30:48 EST


>>>>> "Nicolai" == Nicolai Stange <nicstange@xxxxxxxxx> writes:

Nicolai,

Nicolai> Due to reported problems with Write Same on ATA devices, commit
Nicolai> 0ce1b18c42a5 ("libata: Some drives failing on SCT Write Same")
Nicolai> strived to report non-support for Write Same on non-zoned ATA
Nicolai> devices.

Nicolai> However, due to the following control flow in
Nicolai> sd_config_write_same() this doesn't always take effect, namely
Nicolai> if the ->max_ws_blocks as set in the by the ATA Identify Device
Nicolai> exceeds SD_WS10_BLOCKS:

I'd much prefer for libata to set no_write_same = 1 for non-ZAC devices.

Older SCSI devices have no way to explicitly report that WRITE SAME is
supported. So the heuristic is the way it is to permit trying WRITE SAME
unless no_write_same has been set by the device driver. libata used to
do this prior to the zoned support going in.

Nicolai> Since commit e73c23ff736e ("block: add async variant of
Nicolai> blkdev_issue_zeroout"), blkdev_issue_zeroout() got a little bit
Nicolai> more sensitive towards failing Write Sames on devices that
Nicolai> claim to support them and this results in messages like

That's something that needs to be addressed. blkdev_issue_zeroout() must
cope with WRITE SAME failing and fall back to a manual zeroout.

--
Martin K. Petersen Oracle Linux Engineering