From owner-svn-src-all@FreeBSD.ORG Thu Aug 12 08:35:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96C61106564A; Thu, 12 Aug 2010 08:35:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C0D28FC1B; Thu, 12 Aug 2010 08:35:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7C8ZOGC025090; Thu, 12 Aug 2010 08:35:24 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7C8ZOYm025088; Thu, 12 Aug 2010 08:35:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201008120835.o7C8ZOYm025088@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 12 Aug 2010 08:35:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211212 - head/sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Aug 2010 08:35:24 -0000 Author: kib Date: Thu Aug 12 08:35:24 2010 New Revision: 211212 URL: http://svn.freebsd.org/changeset/base/211212 Log: Softdep_process_worklist() should unsuspend not only before processing the worklist (in softdep_process_journal), but also after flushing the workitems. Might be, we should even do this before bwillwrite() too, but this seems to be not needed for now. Fs might be suspended during processing the queue, and then there is nobody around to unsuspend. In collaboration with: pho Tested by: bz Reviewed by: jeff Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Thu Aug 12 06:20:54 2010 (r211211) +++ head/sys/ufs/ffs/ffs_softdep.c Thu Aug 12 08:35:24 2010 (r211212) @@ -857,6 +857,7 @@ static int journal_mount(struct mount *, static void journal_unmount(struct mount *); static int journal_space(struct ufsmount *, int); static void journal_suspend(struct ufsmount *); +static int journal_unsuspend(struct ufsmount *ump); static void softdep_prelink(struct vnode *, struct vnode *); static void add_to_journal(struct worklist *); static void remove_from_journal(struct worklist *); @@ -1390,6 +1391,8 @@ softdep_process_worklist(mp, full) if (!full && starttime != time_second) break; } + if (full == 0) + journal_unsuspend(ump); FREE_LOCK(&lk); return (matchcnt); } @@ -2436,6 +2439,27 @@ journal_suspend(ump) MNT_IUNLOCK(mp); } +static int +journal_unsuspend(struct ufsmount *ump) +{ + struct jblocks *jblocks; + struct mount *mp; + + mp = UFSTOVFS(ump); + jblocks = ump->softdep_jblocks; + + if (jblocks != NULL && jblocks->jb_suspended && + journal_space(ump, jblocks->jb_min)) { + jblocks->jb_suspended = 0; + FREE_LOCK(&lk); + mp->mnt_susp_owner = curthread; + vfs_write_resume(mp); + ACQUIRE_LOCK(&lk); + return (1); + } + return (0); +} + /* * Called before any allocation function to be certain that there is * sufficient space in the journal prior to creating any new records. @@ -2852,15 +2876,9 @@ softdep_process_journal(mp, flags) * space either try to sync it here to make some progress or * unsuspend it if we already have. */ - if (flags == 0 && jblocks && jblocks->jb_suspended) { - if (journal_space(ump, jblocks->jb_min)) { - FREE_LOCK(&lk); - jblocks->jb_suspended = 0; - mp->mnt_susp_owner = curthread; - vfs_write_resume(mp); - ACQUIRE_LOCK(&lk); + if (flags == 0 && jblocks->jb_suspended) { + if (journal_unsuspend(ump)) return; - } FREE_LOCK(&lk); VFS_SYNC(mp, MNT_NOWAIT); ffs_sbupdate(ump, MNT_WAIT, 0);