Ensure that we send at least LBA range per TRIM.

This commit is contained in:
imp 2020-06-06 06:20:04 +00:00
parent 72d8546ade
commit 8d23ab1df2

View File

@ -1082,6 +1082,7 @@ ndastart(struct cam_periph *periph, union ccb *start_ccb)
TAILQ_INIT(&trim->bps);
bp1 = bp;
ents = min(nitems(trim->dsm), nda_max_trim_entries);
ents = max(ents, 1);
dsm_range = trim->dsm;
dsm_end = dsm_range + ents;
do {