svn commit: r308550 - stable/10/sys/fs/msdosfs

Konstantin Belousov kib at FreeBSD.org
Fri Nov 11 20:04:20 UTC 2016


Author: kib
Date: Fri Nov 11 20:04:19 2016
New Revision: 308550
URL: https://svnweb.freebsd.org/changeset/base/308550

Log:
  MFC r308023:
  If the fatchain() call in chainalloc() returned an error, revert
  marking the cluster run as in-use.

Modified:
  stable/10/sys/fs/msdosfs/msdosfs_fat.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/fs/msdosfs/msdosfs_fat.c
==============================================================================
--- stable/10/sys/fs/msdosfs/msdosfs_fat.c	Fri Nov 11 20:01:56 2016	(r308549)
+++ stable/10/sys/fs/msdosfs/msdosfs_fat.c	Fri Nov 11 20:04:19 2016	(r308550)
@@ -731,8 +731,11 @@ chainalloc(pmp, start, count, fillwith, 
 		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);


More information about the svn-src-all mailing list