Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Dec 2010 00:38:57 +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: r216676 - head/sys/ufs/ffs
Message-ID:  <201012230038.oBN0cv86039142@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mckusick
Date: Thu Dec 23 00:38:57 2010
New Revision: 216676
URL: http://svn.freebsd.org/changeset/base/216676

Log:
  This patch fixes a soft update panic while running perl 5.12 tests
  which produced:
  
      panic: indir_trunc: Index out of range -148 parent -2061 lbn -305164
  
  Reported by: Dimitry Andric
  Fixed by: Jeff Roberson

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

Modified: head/sys/ufs/ffs/ffs_softdep.c
==============================================================================
--- head/sys/ufs/ffs/ffs_softdep.c	Wed Dec 22 23:58:21 2010	(r216675)
+++ head/sys/ufs/ffs/ffs_softdep.c	Thu Dec 23 00:38:57 2010	(r216676)
@@ -6153,7 +6153,8 @@ indir_trunc(freework, dbn, lbn)
 		if (jnewblk->jn_lbn > 0)
 			i = (jnewblk->jn_lbn - -lbn) / lbnadd;
 		else
-			i = (jnewblk->jn_lbn - (lbn + 1)) / lbnadd;
+			i = (-(jnewblk->jn_lbn + level - 1) - -(lbn + level)) /
+			    lbnadd;
 		KASSERT(i >= 0 && i < NINDIR(fs),
 		    ("indir_trunc: Index out of range %d parent %jd lbn %jd",
 		    i, lbn, jnewblk->jn_lbn));



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