From owner-freebsd-bugs@FreeBSD.ORG Sun Jan 5 11:40:00 2014 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 ESMTPS id C686BF85 for ; Sun, 5 Jan 2014 11:40:00 +0000 (UTC) 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 A1F82179C for ; Sun, 5 Jan 2014 11:40: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 s05Be0iv093504 for ; Sun, 5 Jan 2014 11:40:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id s05Be0gV093503; Sun, 5 Jan 2014 11:40:00 GMT (envelope-from gnats) Resent-Date: Sun, 5 Jan 2014 11:40:00 GMT Resent-Message-Id: <201401051140.s05Be0gV093503@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, Anders Berggren 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 ESMTPS id 09340F80 for ; Sun, 5 Jan 2014 11:39:32 +0000 (UTC) Received: from oldred.freebsd.org (oldred.freebsd.org [IPv6:2001:1900:2254:206a::50:4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E99431796 for ; Sun, 5 Jan 2014 11:39:31 +0000 (UTC) Received: from oldred.freebsd.org ([127.0.1.6]) by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id s05BdVq5088930 for ; Sun, 5 Jan 2014 11:39:31 GMT (envelope-from nobody@oldred.freebsd.org) Received: (from nobody@localhost) by oldred.freebsd.org (8.14.5/8.14.5/Submit) id s05BdVpc088920; Sun, 5 Jan 2014 11:39:31 GMT (envelope-from nobody) Message-Id: <201401051139.s05BdVpc088920@oldred.freebsd.org> Date: Sun, 5 Jan 2014 11:39:31 GMT From: Anders Berggren To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: misc/185487: Corrupted files with vfs.unmapped_buf_allowed=1 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jan 2014 11:40:00 -0000 >Number: 185487 >Category: misc >Synopsis: Corrupted files with vfs.unmapped_buf_allowed=1 >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: Sun Jan 05 11:40:00 UTC 2014 >Closed-Date: >Last-Modified: >Originator: Anders Berggren >Release: 10.0-RC4 >Organization: Halon Security >Environment: FreeBSD sp-build10-i386 10.0-RC4 FreeBSD 10.0-RC4 #0 r260130: Tue Dec 31 20:44:17 UTC 2013 root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC i386 >Description: We experienced strange problems with the FreeBSD 10 RC, with builds that failed and Postgres databases that got corrupted. We were able to reduce the problem down to: i=0 while true do i=`expr $i + 1` echo RUN $i dd if=/dev/random of=disktest bs=1m count=1 orig=`md5 -q disktest` cp disktest disktest2 md5 -c $orig disktest2 [ $? -ne 0 ] && echo fail && exit done which failed for us (very randomly, sometimes 10 iterations, sometimes 10000, sometimes never). The issue disappeared when disabling vfs unmapped_buf. We've tested it on different i386 machines, both in VMware and Hyper-V. Not bare-metal, though. When examining corrupted data, it appeared"repeated", as repeated pattern in the file of previously read/written data blocks. >How-To-Repeat: Run the script example above, for us it failed in 10-100000 iterations. We were also able to repeat the problem on real-world, high-traffic PostgreSQL databases. >Fix: vfs.unmapped_buf_allowed="0" in loader.conf >Release-Note: >Audit-Trail: >Unformatted: