svn commit: r354999 - head/sbin/camcontrol

Alexander Motin mav at FreeBSD.org
Fri Nov 22 15:41:48 UTC 2019


Author: mav
Date: Fri Nov 22 15:41:47 2019
New Revision: 354999
URL: https://svnweb.freebsd.org/changeset/base/354999

Log:
  Fix off-by-one error in HPA/AMA maximum reporting.
  
  Before my refactoring the code reported value as maximum number of sectors,
  adding one to the maximum sector number returned by respective command.
  While this difference is somewhat confusing, restore previous behavior.
  
  MFC after:	3 days

Modified:
  head/sbin/camcontrol/camcontrol.c

Modified: head/sbin/camcontrol/camcontrol.c
==============================================================================
--- head/sbin/camcontrol/camcontrol.c	Fri Nov 22 15:06:07 2019	(r354998)
+++ head/sbin/camcontrol/camcontrol.c	Fri Nov 22 15:41:47 2019	(r354999)
@@ -1961,7 +1961,7 @@ atahpa_proc_resp(struct cam_device *device, union ccb 
 	if (hpasize != NULL) {
 		if (retval == 2 || retval == 6)
 			return (1);
-		*hpasize = lba;
+		*hpasize = lba + 1;
 	}
 
 	return (0);


More information about the svn-src-all mailing list