git: 0085afdceb17 - main - fs/msdosfs fatblock: use ulmin() rather than min()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 23 Feb 2024 17:38:00 UTC
The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=0085afdceb17cb7d4e41f9073299f688372c6a0f commit 0085afdceb17cb7d4e41f9073299f688372c6a0f Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2024-02-23 17:30:10 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2024-02-23 17:37:52 +0000 fs/msdosfs fatblock: use ulmin() rather than min() to avoid truncation of pmp->pm_FATsecs. Submitted by: Robert Morris <rtm@lcs.mit.edu> PR: 277237 MFC after: 1 week --- sys/fs/msdosfs/msdosfs_fat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/msdosfs/msdosfs_fat.c b/sys/fs/msdosfs/msdosfs_fat.c index 4a7faa9e1f05..bfaff417f677 100644 --- a/sys/fs/msdosfs/msdosfs_fat.c +++ b/sys/fs/msdosfs/msdosfs_fat.c @@ -97,7 +97,7 @@ fatblock(struct msdosfsmount *pmp, u_long ofs, u_long *bnp, u_long *sizep, fatblocksec /= 2; } bn = ofs / pmp->pm_fatblocksize * pmp->pm_fatblocksec; - size = roundup(min(fatblocksec, pmp->pm_FATsecs - bn) * DEV_BSIZE, + size = roundup(ulmin(fatblocksec, pmp->pm_FATsecs - bn) * DEV_BSIZE, pmp->pm_BlkPerSec * DEV_BSIZE); bn += pmp->pm_fatblk + pmp->pm_curfat * pmp->pm_FATsecs;