1. 12 7月, 2008 1 次提交
    • D
      Fix reference counting race on log buffers · 49641f1a
      Dave Chinner 提交于
      When we release the iclog, we do an atomic_dec_and_lock to determine if
      we are the last reference and need to trigger update of log headers and
      writeout.  However, in xlog_state_get_iclog_space() we also need to
      check if we have the last reference count there.  If we do, we release
      the log buffer, otherwise we decrement the reference count.
      
      But the compare and decrement in xlog_state_get_iclog_space() is not
      atomic, so both places can see a reference count of 2 and neither will
      release the iclog.  That leads to a filesystem hang.
      
      Close the race by replacing the atomic_read() and atomic_dec() pair with
      atomic_add_unless() to ensure that they are executed atomically.
      Signed-off-by: NDave Chinner <david@fromorbit.com>
      Reviewed-by: NTim Shimmin <tes@sgi.com>
      Tested-by: NEric Sandeen <sandeen@sandeen.net>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      49641f1a
  2. 11 7月, 2008 26 次提交
  3. 10 7月, 2008 12 次提交
  4. 09 7月, 2008 1 次提交