Date: Tue, 16 Apr 2019 17:56:53 +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-11@freebsd.org Subject: svn commit: r346289 - stable/11/sys/fs/msdosfs Message-ID: <201904161756.x3GHurUA045077@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Tue Apr 16 17:56:53 2019 New Revision: 346289 URL: https://svnweb.freebsd.org/changeset/base/346289 Log: MFC r346064: Fix dirty buf exhaustion easily triggered with msdosfs. Modified: stable/11/sys/fs/msdosfs/msdosfs_fat.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/msdosfs/msdosfs_fat.c ============================================================================== --- stable/11/sys/fs/msdosfs/msdosfs_fat.c Tue Apr 16 17:55:54 2019 (r346288) +++ stable/11/sys/fs/msdosfs/msdosfs_fat.c Tue Apr 16 17:56:53 2019 (r346289) @@ -52,6 +52,7 @@ #include <sys/systm.h> #include <sys/buf.h> #include <sys/mount.h> +#include <sys/vmmeter.h> #include <sys/vnode.h> #include <fs/msdosfs/bpb.h> @@ -977,6 +978,7 @@ extendfile(struct denode *dep, u_long count, struct bu u_long cn, got; struct msdosfsmount *pmp = dep->de_pmp; struct buf *bp; + struct vop_fsync_args fsync_ap; daddr_t blkno; /* @@ -1086,8 +1088,16 @@ extendfile(struct denode *dep, u_long count, struct bu if (bpp) { *bpp = bp; bpp = NULL; - } else + } else { bdwrite(bp); + } + if (vm_page_count_severe() || + buf_dirty_count_severe()) { + fsync_ap.a_vp = DETOV(dep); + fsync_ap.a_waitfor = MNT_WAIT; + fsync_ap.a_td = curthread; + vop_stdfsync(&fsync_ap); + } } } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201904161756.x3GHurUA045077>