diff options
author | kib <kib@FreeBSD.org> | 2016-11-11 20:04:19 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2016-11-11 20:04:19 +0000 |
commit | 0b3e6982c03ff01421d53c7c0a83af252aeb378c (patch) | |
tree | fc1d724c1519f02019fdfa5f14d5ba5d7acbbbb8 /sys/fs | |
parent | e5dd6e7c333bd81d14c2e058b9a635fb2f661398 (diff) | |
download | FreeBSD-src-0b3e6982c03ff01421d53c7c0a83af252aeb378c.zip FreeBSD-src-0b3e6982c03ff01421d53c7c0a83af252aeb378c.tar.gz |
MFC r308023:
If the fatchain() call in chainalloc() returned an error, revert
marking the cluster run as in-use.
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/msdosfs/msdosfs_fat.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/fs/msdosfs/msdosfs_fat.c b/sys/fs/msdosfs/msdosfs_fat.c index 5229aea..2e41147 100644 --- a/sys/fs/msdosfs/msdosfs_fat.c +++ b/sys/fs/msdosfs/msdosfs_fat.c @@ -731,8 +731,11 @@ chainalloc(pmp, start, count, fillwith, retcluster, got) pmp->pm_nxtfree = CLUST_FIRST; pmp->pm_flags |= MSDOSFS_FSIMOD; error = fatchain(pmp, start, count, fillwith); - if (error != 0) + if (error != 0) { + for (cl = start, n = count; n-- > 0;) + usemap_free(pmp, cl++); return (error); + } #ifdef MSDOSFS_DEBUG printf("clusteralloc(): allocated cluster chain at %lu (%lu clusters)\n", start, count); |