Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Feb 2001 03:14:39 -0800 (PST)
From:      Kirk McKusick <mckusick@FreeBSD.org>
To:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/sys/ufs/ffs ffs_softdep.c
Message-ID:  <200102201114.f1KBEdt16964@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
mckusick    2001/02/20 03:14:39 PST

  Modified files:
    sys/ufs/ffs          ffs_softdep.c 
  Log:
  This patch corrects two problems with the rate limiting code
  that was introduced in revision 1.80. The problem manifested
  itself with a `locking against myself' panic and could also
  result in soft updates inconsistences associated with inodedeps.
  The two problems are:
  
  1) One of the background operations could manipulate the bitmap
  while holding it locked with intent to create. This held lock
  results in a `locking against myself' panic, when the background
  processing that we have been coopted to do tries to lock the bitmap
  which we are already holding locked. To understand how to fix this
  problem, first, observe that we can do the background cleanups in
  inodedep_lookup only when allocating inodedeps (DEPALLOC is set in
  the call to inodedep_lookup). Second observe that calls to
  inodedep_lookup with DEPALLOC set can only happen from the following
  calls into the softdep code:
  
          softdep_setup_inomapdep
          softdep_setup_allocdirect
          softdep_setup_remove
          softdep_setup_freeblocks
          softdep_setup_directory_change
          softdep_setup_directory_add
          softdep_change_linkcnt
  
  Only the first two of these can come from ffs_alloc.c while holding
  a bitmap locked. Thus, inodedep_lookup must not go off to do
  request_cleanups when being called from these functions. This change
  adds a flag, NODELAY, that can be passed to inodedep_lookup to let
  it know that it should not do background processing in those cases.
  
  2) The return value from request_cleanup when helping out with the
  cleanup was 0 instead of 1. This meant that despite the fact that
  we may have slept while doing the cleanups, the code did not recheck
  for the appearance of an inodedep (e.g., goto top in inodedep_lookup).
  This lead to the softdep inconsistency in which we ended up with
  two inodedep's for the same inode.
  
  Reviewed by:	Peter Wemm <peter@yahoo-inc.com>,
  		Matt Dillon <dillon@earth.backplane.com>
  
  Revision  Changes    Path
  1.85      +10 -5     src/sys/ufs/ffs/ffs_softdep.c


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




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