Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Nov 2016 19:35:58 +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-11@freebsd.org
Subject:   svn commit: r308543 - stable/11/sys/fs/msdosfs
Message-ID:  <201611111935.uABJZwbK000200@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Fri Nov 11 19:35:58 2016
New Revision: 308543
URL: https://svnweb.freebsd.org/changeset/base/308543

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

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

Modified: stable/11/sys/fs/msdosfs/msdosfs_fat.c
==============================================================================
--- stable/11/sys/fs/msdosfs/msdosfs_fat.c	Fri Nov 11 19:33:26 2016	(r308542)
+++ stable/11/sys/fs/msdosfs/msdosfs_fat.c	Fri Nov 11 19:35:58 2016	(r308543)
@@ -691,8 +691,11 @@ chainalloc(struct msdosfsmount *pmp, u_l
 		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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611111935.uABJZwbK000200>