From c66f901b8e4101435a1671fb943031198361beb1 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Thu, 3 Oct 2024 14:54:11 +0300 Subject: [PATCH] loader: dosfs fails to access directory data with large cluster number fsize is using 2 bytes for cluster number, but with fat32 we actually do have 4 bytes and with large disks the high bytes will be in use. illumos issue: https://www.illumos.org/issues/16821 Sponsored by: MNX Cloud, Inc. (cherry picked from commit 79a0d14fa05c75038caa52099289effb85732f88) --- stand/libsa/dosfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/libsa/dosfs.c b/stand/libsa/dosfs.c index 06215b1ab0fdb7..6f7b207ff4048a 100644 --- a/stand/libsa/dosfs.c +++ b/stand/libsa/dosfs.c @@ -816,7 +816,7 @@ fsize(DOS_FS *fs, DOS_DE *de) int n; if (!(size = cv4(de->size)) && de->attr & FA_DIR) { - if (!(c = cv2(de->clus))) { + if (!(c = stclus(fs->fatsz, de))) { size = fs->dirents * sizeof(DOS_DE); } else { if ((n = fatcnt(fs, c)) == -1)