>>>>> "hpa" == H Peter Anvin <hpa@xxxxxxxxx> writes: >> If a drive has some quirky behaviour wrt WRITE SAME, then that should >> be handled in some place where 'quirks' are handled - certainly not >> in md. hpa> The problem here is that you don't find out ahead of time. hpa> Now, if I understand the issue at hand correctly is that the hpa> reporting here was actually a Linux bug related to SATA drives hpa> behind a SAS controller. Martin, am I right? Support for WRITE SAME is harder for us to detect. With discard we have a set of device-reported bits we can use as triggers, not so for WRITE SAME. And since it is a destructive command we can not simply issue one at device discovery time to try whether it works. Technically there's nothing that prevents a SAS controller's SCSI-ATA Translation to handle WRITE SAME. The patch I posted simply adds another heuristic. Namely that if we can see that the drive behind the SAS controller is of the ATA persuasion we will not attempt to issue WRITE SAME unless the controller explicitly advertises WRITE SAME support using REPORT SUPPORTED OPERATION CODES. Sadly we can not exclusively rely on RSOC when deciding whether WRITE SAME is supported or not for devices in general. 95% of the WRITE SAME-capable devices out there do not support RSOC :( -- Martin K. Petersen Oracle Linux Engineering -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html