Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Jul 2017 18:36:17 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r321348 - head/sys/ufs/ffs
Message-ID:  <201707211836.v6LIaHN5063055@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Fri Jul 21 18:36:17 2017
New Revision: 321348
URL: https://svnweb.freebsd.org/changeset/base/321348

Log:
  Unlock correct lock in ffs_snapblkfree().
  
  It is possible for ffs_snapblkfree() to race and lock snaplock while
  the devvp snapdata is instantiated, but no snapshots exist.  In this
  case the loop over snapshots in ffs_snapblkfree() is not executed, and
  the local variable vp is left initialized to NULL.
  
  Unlock using &sn->sn_lock and not vp->v_vnlock.  For the inodes on the
  snapshot list, the locks are same.
  
  Reported and tested by:	pho
  Sponsored by:	The FreeBSD Foundation
  MFC after:	2 weeks

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

Modified: head/sys/ufs/ffs/ffs_snapshot.c
==============================================================================
--- head/sys/ufs/ffs/ffs_snapshot.c	Fri Jul 21 18:28:27 2017	(r321347)
+++ head/sys/ufs/ffs/ffs_snapshot.c	Fri Jul 21 18:36:17 2017	(r321348)
@@ -1935,7 +1935,7 @@ retry:
 	 */
 	if (error != 0 && wkhd != NULL)
 		softdep_freework(wkhd);
-	lockmgr(vp->v_vnlock, LK_RELEASE, NULL);
+	lockmgr(&sn->sn_lock, LK_RELEASE, NULL);
 	return (error);
 }
 



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