Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Jul 2020 12:24:40 +0000 (UTC)
From:      Toomas Soome <tsoome@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r362989 - head/stand/libsa/geli
Message-ID:  <202007071224.067COe7F025029@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tsoome
Date: Tue Jul  7 12:24:40 2020
New Revision: 362989
URL: https://svnweb.freebsd.org/changeset/base/362989

Log:
  loader: geli_dev_ioctl does return huge mediasize
  
  The DIOCGMEDIASIZE is calculated md->md_sectorsize * md->md_provsize, and
  for boot disk, the md_sectorsize is 4k. However, the md_provsize is already
  in units of bytes.
  
  Sponsored by:	Netflix, Klara Inc.

Modified:
  head/stand/libsa/geli/gelidev.c

Modified: head/stand/libsa/geli/gelidev.c
==============================================================================
--- head/stand/libsa/geli/gelidev.c	Tue Jul  7 12:10:59 2020	(r362988)
+++ head/stand/libsa/geli/gelidev.c	Tue Jul  7 12:24:40 2020	(r362989)
@@ -219,7 +219,7 @@ geli_dev_ioctl(struct open_file *f, u_long cmd, void *
 		*(u_int *)data = md->md_sectorsize;
 		break;
 	case DIOCGMEDIASIZE:
-		*(uint64_t *)data = md->md_sectorsize * md->md_provsize;
+		*(uint64_t *)data = md->md_provsize;
 		break;
 	default:
 		return (ENOTTY);



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