Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Jul 2011 05:34:49 +0000 (UTC)
From:      Kirk McKusick <mckusick@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r223902 - head/sys/ufs/ffs
Message-ID:  <201107100534.p6A5YnT6031834@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mckusick
Date: Sun Jul 10 05:34:49 2011
New Revision: 223902
URL: http://svn.freebsd.org/changeset/base/223902

Log:
  When first creating snapshots, we may free some blocks within it.
  These blocks should not have TRIM applied to them.
  
  Submitted by: Kostik Belousov

Modified:
  head/sys/ufs/ffs/ffs_alloc.c

Modified: head/sys/ufs/ffs/ffs_alloc.c
==============================================================================
--- head/sys/ufs/ffs/ffs_alloc.c	Sun Jul 10 00:53:04 2011	(r223901)
+++ head/sys/ufs/ffs/ffs_alloc.c	Sun Jul 10 05:34:49 2011	(r223902)
@@ -2038,7 +2038,11 @@ ffs_blkfree(ump, fs, devvp, bno, size, i
 	    ffs_snapblkfree(fs, devvp, bno, size, inum, vtype, dephd)) {
 		return;
 	}
-	if (!ump->um_candelete) {
+	/*
+	 * Nothing to delay if TRIM is disabled, or the operation is
+	 * performed on the snapshot.
+	 */
+	if (!ump->um_candelete || devvp->v_type == VREG) {
 		ffs_blkfree_cg(ump, fs, devvp, bno, size, inum, dephd);
 		return;
 	}



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