Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Jan 2025 20:16:37 GMT
From:      Poul-Henning Kamp <phk@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: d830cac9fed1 - main - recoverdisk: Fix comparison between stripesize and sectorsize
Message-ID:  <202501052016.505KGbXu056648@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by phk:

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

commit d830cac9fed1882a192b0ec5c96fb3ac9bfbc2ee
Author:     Poul-Henning Kamp <phk@FreeBSD.org>
AuthorDate: 2025-01-05 20:14:37 +0000
Commit:     Poul-Henning Kamp <phk@FreeBSD.org>
CommitDate: 2025-01-05 20:16:22 +0000

    recoverdisk: Fix comparison between stripesize and sectorsize
    
    Discovered trying to read a 360KB floppy disk :-)
---
 sbin/recoverdisk/recoverdisk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sbin/recoverdisk/recoverdisk.c b/sbin/recoverdisk/recoverdisk.c
index 91f42c904c52..446266c36d50 100644
--- a/sbin/recoverdisk/recoverdisk.c
+++ b/sbin/recoverdisk/recoverdisk.c
@@ -482,7 +482,7 @@ main(int argc, char * const argv[])
 			err(1, "DIOCGSECTORSIZE failed");
 
 		error = ioctl(fdr, DIOCGSTRIPESIZE, &stripesize);
-		if (error == 0 && stripesize > sectorsize)
+		if (error == 0 && stripesize < sectorsize)
 			sectorsize = stripesize;
 
 		minsize = sectorsize;



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