From owner-freebsd-bugs@FreeBSD.ORG Fri Dec 10 14:10:09 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 372E91065670 for ; Fri, 10 Dec 2010 14:10:09 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 13F9F8FC19 for ; Fri, 10 Dec 2010 14:10:09 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id oBAEA8iA054028 for ; Fri, 10 Dec 2010 14:10:08 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id oBAEA8oW054027; Fri, 10 Dec 2010 14:10:08 GMT (envelope-from gnats) Resent-Date: Fri, 10 Dec 2010 14:10:08 GMT Resent-Message-Id: <201012101410.oBAEA8oW054027@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, Luca Pizzamiglio Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B040106564A for ; Fri, 10 Dec 2010 14:04:18 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (unknown [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 501018FC08 for ; Fri, 10 Dec 2010 14:04:18 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id oBAE4IDc000843 for ; Fri, 10 Dec 2010 14:04:18 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id oBAE4I97000842; Fri, 10 Dec 2010 14:04:18 GMT (envelope-from nobody) Message-Id: <201012101404.oBAE4I97000842@red.freebsd.org> Date: Fri, 10 Dec 2010 14:04:18 GMT From: Luca Pizzamiglio To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/152991: [ufs] false disk full with a too slow flash module X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Dec 2010 14:10:09 -0000 >Number: 152991 >Category: kern >Synopsis: [ufs] false disk full with a too slow flash module >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: Fri Dec 10 14:10:08 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Luca Pizzamiglio >Release: FreeBSD 7-stable and 8-stable >Organization: >Environment: FreeBSD pizzamig 7.3-STABLE FreeBSD 7.3-STABLE #22: Thu Nov 11 10:10:06 CET 2010 root@pizzamig:/usr/obj/usr/src/sys/PIZZAMIG i386 >Description: I use a 4 GB PATA flash module with about 1 GB free space. I launch restore(8) to restore the filesystem (dump of ~ 3 GB) and after about 1 GB I receive a "write: disk full" error msg. After this message, everything is fine and at the end I've just one file corrupted, the message related one. The speed of my flash module vary a lot during this procedure. When the speed is extremely/dramatically low, the file system allocate routine invokes softdep_request_cleanup to free pending blocks. In my case, this function is not able to free any pending blocks, so the disk is considered full. This function computes timeout at start, then call ffs_update() to update some metadata and start to free pending blocks if timeout is not expired. In my case, the ffs_update() is so slow that the timeout expires and the disk is considered full. >How-To-Repeat: >Fix: I propose to compute the timeout after the ffs_update(), I guess it is more coherent. A patch is attached. Patch attached with submission follows: Index: ffs_softdep.c =================================================================== --- ffs_softdep.c (revision 3162) +++ ffs_softdep.c (working copy) @@ -5796,7 +5796,6 @@ ump = VTOI(vp)->i_ump; mtx_assert(UFS_MTX(ump), MA_OWNED); needed = fs->fs_cstotal.cs_nbfree + fs->fs_contigsumsize; - starttime = time_second + tickdelay; /* * If we are being called because of a process doing a * copy-on-write, then it is not safe to update the vnode @@ -5809,6 +5808,7 @@ if (error != 0) return (0); } + starttime = time_second + tickdelay; while (fs->fs_pendingblocks > 0 && fs->fs_cstotal.cs_nbfree <= needed) { if (time_second > starttime) return (0); >Release-Note: >Audit-Trail: >Unformatted: