Author: imp
Date: Sat Jun  6 06:20:04 2020
New Revision: 361865
URL: https://svnweb.freebsd.org/changeset/base/361865

Log:
  Ensure that we send at least LBA range per TRIM.

Modified:
  head/sys/cam/nvme/nvme_da.c

Modified: head/sys/cam/nvme/nvme_da.c
==============================================================================
--- head/sys/cam/nvme/nvme_da.c Sat Jun  6 06:17:51 2020        (r361864)
+++ head/sys/cam/nvme/nvme_da.c Sat Jun  6 06:20:04 2020        (r361865)
@@ -1082,6 +1082,7 @@ ndastart(struct cam_periph *periph, union ccb *start_c
                        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 {
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to