TESTS: Unmap. Clamp max number of unmap blocks to 256 if the target reports

no limit

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
This commit is contained in:
Ronnie Sahlberg
2016-11-15 18:37:59 -08:00
parent 04b029dc88
commit 3a598ea846

View File

@@ -72,6 +72,10 @@ test_unmap_simple(void)
if (inq_bl->max_unmap_bdc > 0 && max_nr_bdc > (int)inq_bl->max_unmap_bdc) {
max_nr_bdc = (int)inq_bl->max_unmap_bdc;
}
if (max_nr_bdc < 0 || max_nr_bdc > 256) {
logging(LOG_VERBOSE, "Clamp max unmapped blocks to 256");
max_nr_bdc = 256;
}
logging(LOG_VERBOSE, "Test UNMAP of 1-%d blocks at the start of the "
"LUN with one descriptor per block", max_nr_bdc);