From owner-freebsd-bugs@FreeBSD.ORG Wed Sep 18 20:40: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 CCAAE2D3 for ; Wed, 18 Sep 2013 20:40: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 AC66424E0 for ; Wed, 18 Sep 2013 20: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 r8IKe0DR089345 for ; Wed, 18 Sep 2013 20: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 r8IKe07n089338; Wed, 18 Sep 2013 20:40:00 GMT (envelope-from gnats) Resent-Date: Wed, 18 Sep 2013 20:40:00 GMT Resent-Message-Id: <201309182040.r8IKe07n089338@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, dennis chang Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B6478151 for ; Wed, 18 Sep 2013 20:33:21 +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 89E3524A1 for ; Wed, 18 Sep 2013 20:33:21 +0000 (UTC) Received: from oldred.freebsd.org ([127.0.1.6]) by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r8IKXK6S048407 for ; Wed, 18 Sep 2013 20:33:20 GMT (envelope-from nobody@oldred.freebsd.org) Received: (from nobody@localhost) by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r8IKXKwO048401; Wed, 18 Sep 2013 20:33:20 GMT (envelope-from nobody) Message-Id: <201309182033.r8IKXKwO048401@oldred.freebsd.org> Date: Wed, 18 Sep 2013 20:33:20 GMT From: dennis chang To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: kern/182214: vop_stdfsync() incorrectly retries too many times 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: Wed, 18 Sep 2013 20:40:00 -0000 >Number: 182214 >Category: kern >Synopsis: vop_stdfsync() incorrectly retries too many times >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: Wed Sep 18 20:40:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: dennis chang >Release: 7.2 and 10 >Organization: panasas >Environment: >Description: 687 /* 688 * If synchronous the caller expects us to completely resolve all 689 * dirty buffers in the system. Wait for in-progress I/O to 690 * complete (which could include background bitmap writes), then 691 * retry if dirty blocks still exist. 692 */ 693 if (ap->a_waitfor == MNT_WAIT) { 694 bufobj_wwait(bo, 0, 0); 695 if (bo->bo_dirty.bv_cnt > 0) { 696 /* 697 * If we are unable to write any of these buffers 698 * then we fail now rather than trying endlessly 699 * to write them out. 700 */ 701 TAILQ_FOREACH(bp, &bo->bo_dirty.bv_hd, b_bobufs) 702 if ((error = bp->b_error) == 0) ---> error is constantly overwritten. It should bail out when any buffer has an error. 703 continue; 704 if (error == 0 && --maxretry >= 0) ----> error is from the last buffer, instead of any buffer. 705 goto loop1; 706 error = EAGAIN; 707 } 708 } >How-To-Repeat: >Fix: 687 /* 688 * If synchronous the caller expects us to completely resolve all 689 * dirty buffers in the system. Wait for in-progress I/O to 690 * complete (which could include background bitmap writes), then 691 * retry if dirty blocks still exist. 692 */ 693 if (ap->a_waitfor == MNT_WAIT) { 694 bufobj_wwait(bo, 0, 0); 695 if (bo->bo_dirty.bv_cnt > 0) { 696 /* 697 * If we are unable to write any of these buffers 698 * then we fail now rather than trying endlessly 699 * to write them out. 700 */ 701 TAILQ_FOREACH(bp, &bo->bo_dirty.bv_hd, b_bobufs) { 702 if (bp->b_error) 703 error = b_error; break; } } 704 if (error == 0 && --maxretry >= 0) 705 goto loop1; 706 error = EAGAIN; 707 } 708 } >Release-Note: >Audit-Trail: >Unformatted: