Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Nov 2019 15:41:47 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r354999 - head/sbin/camcontrol
Message-ID:  <201911221541.xAMFfltJ053266@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201911221541.xAMFfltJ053266>