From owner-freebsd-bugs@FreeBSD.ORG Tue Sep 17 07:30:00 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AAC1E7B0 for ; Tue, 17 Sep 2013 07:30:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8BED520B1 for ; Tue, 17 Sep 2013 07:30:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r8H7U0cr012545 for ; Tue, 17 Sep 2013 07:30:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r8H7U0YV012544; Tue, 17 Sep 2013 07:30:00 GMT (envelope-from gnats) Resent-Date: Tue, 17 Sep 2013 07:30:00 GMT Resent-Message-Id: <201309170730.r8H7U0YV012544@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Alexey Markov Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8E4AB75A for ; Tue, 17 Sep 2013 07:25:03 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 61244208A for ; Tue, 17 Sep 2013 07:25:03 +0000 (UTC) Received: from oldred.freebsd.org ([127.0.1.6]) by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r8H7P25G026852 for ; Tue, 17 Sep 2013 07:25:02 GMT (envelope-from nobody@oldred.freebsd.org) Received: (from nobody@localhost) by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r8H7P2oG026848; Tue, 17 Sep 2013 07:25:02 GMT (envelope-from nobody) Message-Id: <201309170725.r8H7P2oG026848@oldred.freebsd.org> Date: Tue, 17 Sep 2013 07:25:02 GMT From: Alexey Markov To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: kern/182181: UFS: Leakage of vnode references (race condition?) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Sep 2013 07:30:00 -0000 >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@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: