kern/182181: UFS: Leakage of vnode references (race condition?)

Alexey Markov redrat at mail.ru
Tue Sep 17 07:30:00 UTC 2013


>Number:         182181
>Category:       kern
>Synopsis:       UFS: Leakage of vnode references (race condition?)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 17 07:30:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Alexey Markov
>Release:        8.4-RELEASE-p3
>Organization:
JSC Complitex
>Environment:
FreeBSD ku-old.memo.ru 8.4-RELEASE-p3 FreeBSD 8.4-RELEASE-p3 #0: Fri Aug 23 13:32:07 MSK 2013 support at ku-new.memo.ru:/arc/obj/arc/src/sys/KU-OLD amd64
>Description:
While running pgbench PostgreSQL benchmark I suddenly found a vnode leakage which leads in particular to an inability to unmount partition.
>How-To-Repeat:
Install a releng/8.4 branch, PostgreSQL 9.1 from ports, set "wal_level = hot_standby" and "wal_keep_segments = 32" in the postgresql.conf, make a dedicated partition for testing and run a following script:

#!/bin/sh -e

i=0

while (true); do
  i=$(($i+1))
  echo Iteration: ${i}

  # Format and mount a pristine filesystem
  newfs -n /dev/da0s1f > /dev/null
  mount /test

  # Prepare an empty instance
  tar xjf /root/pgsql.tbz -C /test

  # Start the PostgreSQL
  /usr/local/etc/rc.d/postgresql start

  # Run a pgbench
  date
  su - pgsql -c "pgbench -i -s 1000 pgbench 2> /dev/null"
  date
  df -i /test
  du -xs /test

  # Stop the PostgreSQL
  /usr/local/etc/rc.d/postgresql stop

  # Try to unmount the filesystem
  umount /test
done

Result is:

ku-old:home/support# /root/2.sh
Iteration: 1
вторник, 17 сентября 2013 г. 09:33:54 (MSK)
вторник, 17 сентября 2013 г. 10:44:34 (MSK)
Filesystem  1K-blocks     Used    Avail Capacity iused   ifree %iused  Mounted on
/dev/da0s1f  56616608 15951754 36135526    31%    1053 7323617    0%   /test
15951742        /test
umount: unmount of /test failed: Device busy

ku-old:home/support# rm -rf /test/*
ku-old:home/support# df -i /test; du -xs /test
Filesystem  1K-blocks Used    Avail Capacity iused   ifree %iused  Mounted on
/dev/da0s1f  56616608   14 52087266     0%       2 7324668    0%   /test
2       /test

As you can see, df shows 12 KiB (6 fragments) more than du. After force unmount and remount both shows 2 KiB as expected.
>Fix:
It seems a very similar bug was recently fixed in the HEAD and 9-STABLE: http://svnweb.freebsd.org/changeset/base/253998

I will try to apply that fix to my 8-RELEASE server and run a testing script again, but it will take a time.

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list