Date: Mon, 28 Dec 2015 09:03:29 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292830 - stable/10/sys/ufs/ffs Message-ID: <201512280903.tBS93TDU025009@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Mon Dec 28 09:03:29 2015 New Revision: 292830 URL: https://svnweb.freebsd.org/changeset/base/292830 Log: MFC r292541: Recheck curthread->td_su after the VFS_SYNC() call. Modified: stable/10/sys/ufs/ffs/ffs_softdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_softdep.c Mon Dec 28 08:53:31 2015 (r292829) +++ stable/10/sys/ufs/ffs/ffs_softdep.c Mon Dec 28 09:03:29 2015 (r292830) @@ -13300,43 +13300,43 @@ softdep_ast_cleanup_proc(void) bool req; td = curthread; - mp = td->td_su; - if (mp == NULL) - return; - td->td_su = NULL; - error = vfs_busy(mp, MBF_NOWAIT); - vfs_rel(mp); - if (error != 0) - return; - if (ffs_own_mount(mp) && MOUNTEDSOFTDEP(mp)) { - ump = VFSTOUFS(mp); - for (;;) { - req = false; - ACQUIRE_LOCK(ump); - if (softdep_excess_items(ump, D_INODEDEP)) { - req = true; - request_cleanup(mp, FLUSH_INODES); - } - if (softdep_excess_items(ump, D_DIRREM)) { - req = true; - request_cleanup(mp, FLUSH_BLOCKS); - } - FREE_LOCK(ump); - if (softdep_excess_items(ump, D_NEWBLK) || - softdep_excess_items(ump, D_ALLOCDIRECT) || - softdep_excess_items(ump, D_ALLOCINDIR)) { - error = vn_start_write(NULL, &mp, V_WAIT); - if (error == 0) { + while ((mp = td->td_su) != NULL) { + td->td_su = NULL; + error = vfs_busy(mp, MBF_NOWAIT); + vfs_rel(mp); + if (error != 0) + return; + if (ffs_own_mount(mp) && MOUNTEDSOFTDEP(mp)) { + ump = VFSTOUFS(mp); + for (;;) { + req = false; + ACQUIRE_LOCK(ump); + if (softdep_excess_items(ump, D_INODEDEP)) { req = true; - VFS_SYNC(mp, MNT_WAIT); - vn_finished_write(mp); + request_cleanup(mp, FLUSH_INODES); } + if (softdep_excess_items(ump, D_DIRREM)) { + req = true; + request_cleanup(mp, FLUSH_BLOCKS); + } + FREE_LOCK(ump); + if (softdep_excess_items(ump, D_NEWBLK) || + softdep_excess_items(ump, D_ALLOCDIRECT) || + softdep_excess_items(ump, D_ALLOCINDIR)) { + error = vn_start_write(NULL, &mp, + V_WAIT); + if (error == 0) { + req = true; + VFS_SYNC(mp, MNT_WAIT); + vn_finished_write(mp); + } + } + if ((td->td_pflags & TDP_KTHREAD) != 0 || !req) + break; } - if ((td->td_pflags & TDP_KTHREAD) != 0 || !req) - break; } + vfs_unbusy(mp); } - vfs_unbusy(mp); } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201512280903.tBS93TDU025009>