Date: Fri, 18 Oct 2019 08:34:53 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r353719 - stable/12/sys/fs/msdosfs Message-ID: <201910180834.x9I8YrbE059776@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Fri Oct 18 08:34:52 2019 New Revision: 353719 URL: https://svnweb.freebsd.org/changeset/base/353719 Log: MFC r353446: Plug the rest of undef behavior places that were missed in r337456. Modified: stable/12/sys/fs/msdosfs/msdosfs_fat.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/msdosfs/msdosfs_fat.c ============================================================================== --- stable/12/sys/fs/msdosfs/msdosfs_fat.c Fri Oct 18 07:55:01 2019 (r353718) +++ stable/12/sys/fs/msdosfs/msdosfs_fat.c Fri Oct 18 08:34:52 2019 (r353719) @@ -389,9 +389,10 @@ usemap_alloc(struct msdosfsmount *pmp, u_long cn) pmp->pm_maxcluster)); KASSERT((pmp->pm_flags & MSDOSFSMNT_RONLY) == 0, ("usemap_alloc on ro msdosfs mount")); - KASSERT((pmp->pm_inusemap[cn / N_INUSEBITS] & (1 << (cn % N_INUSEBITS))) - == 0, ("Allocating used sector %ld %ld %x", cn, cn % N_INUSEBITS, - (unsigned)pmp->pm_inusemap[cn / N_INUSEBITS])); + KASSERT((pmp->pm_inusemap[cn / N_INUSEBITS] & + (1U << (cn % N_INUSEBITS))) == 0, + ("Allocating used sector %ld %ld %x", cn, cn % N_INUSEBITS, + (unsigned)pmp->pm_inusemap[cn / N_INUSEBITS])); pmp->pm_inusemap[cn / N_INUSEBITS] |= 1U << (cn % N_INUSEBITS); KASSERT(pmp->pm_freeclustercount > 0, ("usemap_alloc: too little")); pmp->pm_freeclustercount--; @@ -410,9 +411,10 @@ usemap_free(struct msdosfsmount *pmp, u_long cn) ("usemap_free on ro msdosfs mount")); pmp->pm_freeclustercount++; pmp->pm_flags |= MSDOSFS_FSIMOD; - KASSERT((pmp->pm_inusemap[cn / N_INUSEBITS] & (1 << (cn % N_INUSEBITS))) - != 0, ("Freeing unused sector %ld %ld %x", cn, cn % N_INUSEBITS, - (unsigned)pmp->pm_inusemap[cn / N_INUSEBITS])); + KASSERT((pmp->pm_inusemap[cn / N_INUSEBITS] & + (1U << (cn % N_INUSEBITS))) != 0, + ("Freeing unused sector %ld %ld %x", cn, cn % N_INUSEBITS, + (unsigned)pmp->pm_inusemap[cn / N_INUSEBITS])); pmp->pm_inusemap[cn / N_INUSEBITS] &= ~(1U << (cn % N_INUSEBITS)); } @@ -651,7 +653,7 @@ chainlength(struct msdosfsmount *pmp, u_long start, u_ idx = start / N_INUSEBITS; start %= N_INUSEBITS; map = pmp->pm_inusemap[idx]; - map &= ~((1 << start) - 1); + map &= ~((1U << start) - 1); if (map) { len = ffs(map) - 1 - start; len = MIN(len, count);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201910180834.x9I8YrbE059776>