From owner-svn-src-stable@FreeBSD.ORG Sun Dec 29 07:29:45 2013 Return-Path: Delivered-To: svn-src-stable@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 CBEB6FCB; Sun, 29 Dec 2013 07:29:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (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 9D5891FB4; Sun, 29 Dec 2013 07:29:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBT7TjqH003934; Sun, 29 Dec 2013 07:29:45 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBT7TjaL003933; Sun, 29 Dec 2013 07:29:45 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201312290729.rBT7TjaL003933@svn.freebsd.org> From: Kirk McKusick Date: Sun, 29 Dec 2013 07:29:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r260034 - stable/9/sys/ufs/ffs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Dec 2013 07:29:45 -0000 Author: mckusick Date: Sun Dec 29 07:29:45 2013 New Revision: 260034 URL: http://svnweb.freebsd.org/changeset/base/260034 Log: MFC of 258789: We needlessly panic when trying to flush MKDIR_PARENT dependencies. We had previously tried to flush all MKDIR_PARENT dependencies (and all the NEWBLOCK pagedeps) by calling ffs_update(). However this will only resolve these dependencies in direct blocks. So very large directories with MKDIR_PARENT dependencies in indirect blocks had not yet gotten flushed. As the directory is in the midst of doing a complete sync, we simply defer the checking of the MKDIR_PARENT dependencies until the indirect blocks have been sync'ed. Reported by: Shawn Wallbridge of imaginaryforces.com Tested by: John-Mark Gurney PR: 183424 Modified: stable/9/sys/ufs/ffs/ffs_softdep.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- stable/9/sys/ufs/ffs/ffs_softdep.c Sun Dec 29 07:26:48 2013 (r260033) +++ stable/9/sys/ufs/ffs/ffs_softdep.c Sun Dec 29 07:29:45 2013 (r260034) @@ -12618,7 +12618,9 @@ flush_pagedep_deps(pvp, mp, diraddhdp) int error = 0; struct buf *bp; ino_t inum; + struct diraddhd unfinished; + LIST_INIT(&unfinished); ump = VFSTOUFS(mp); restart: while ((dap = LIST_FIRST(diraddhdp)) != NULL) { @@ -12636,8 +12638,20 @@ restart: */ if (dap != LIST_FIRST(diraddhdp)) continue; - if (dap->da_state & MKDIR_PARENT) - panic("flush_pagedep_deps: MKDIR_PARENT"); + /* + * All MKDIR_PARENT dependencies and all the + * NEWBLOCK pagedeps that are contained in direct + * blocks were resolved by doing above ffs_update. + * Pagedeps contained in indirect blocks may + * require a complete sync'ing of the directory. + * We are in the midst of doing a complete sync, + * so if they are not resolved in this pass we + * defer them for now as they will be sync'ed by + * our caller shortly. + */ + LIST_REMOVE(dap, da_pdlist); + LIST_INSERT_HEAD(&unfinished, dap, da_pdlist); + continue; } /* * A newly allocated directory must have its "." and @@ -12745,6 +12759,10 @@ retry: } if (error) ACQUIRE_LOCK(&lk); + while ((dap = LIST_FIRST(&unfinished)) != NULL) { + LIST_REMOVE(dap, da_pdlist); + LIST_INSERT_HEAD(diraddhdp, dap, da_pdlist); + } return (error); }