Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Oct 2021 01:16:41 GMT
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 06d16b8e9ba9 - stable/12 - loader: geli_dev_ioctl does return huge mediasize
Message-ID:  <202110080116.1981GfQU010884@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by kevans:

URL: https://cgit.FreeBSD.org/src/commit/?id=06d16b8e9ba9f1ad0540c54402485081e0dbf93e

commit 06d16b8e9ba9f1ad0540c54402485081e0dbf93e
Author:     Toomas Soome <tsoome@FreeBSD.org>
AuthorDate: 2020-07-07 12:24:40 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2021-10-08 01:15:59 +0000

    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.
    
    (cherry picked from commit 0d1a62068123df267e20530c86d2fc7a4e1aaa2e)
---
 stand/libsa/geli/gelidev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/stand/libsa/geli/gelidev.c b/stand/libsa/geli/gelidev.c
index 8c1359c0b49a..751255636112 100644
--- a/stand/libsa/geli/gelidev.c
+++ b/stand/libsa/geli/gelidev.c
@@ -219,7 +219,7 @@ geli_dev_ioctl(struct open_file *f, u_long cmd, void *data)
 		*(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?202110080116.1981GfQU010884>