summaryrefslogtreecommitdiffstats
path: root/sys/ufs/ffs/ffs_vfsops.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2015-07-01 06:54:25 +0000
committerkib <kib@FreeBSD.org>2015-07-01 06:54:25 +0000
commitfebe4e6e91057701646038ee282ff0d56df65c5d (patch)
treeb43cef5d29f3be05e4455e14d5c703a88dc88cef /sys/ufs/ffs/ffs_vfsops.c
parent854f0423fc9eaa8349d5c597f52271f0412cdeb5 (diff)
downloadFreeBSD-src-febe4e6e91057701646038ee282ff0d56df65c5d.zip
FreeBSD-src-febe4e6e91057701646038ee282ff0d56df65c5d.tar.gz
MFC r284495:
Keep a vnode which is freed but still owing inactivation, on the active list. This closes a race where such vnode is not msync-ed until reboot.
Diffstat (limited to 'sys/ufs/ffs/ffs_vfsops.c')
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 0bcb084..53d85bd 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -1409,6 +1409,14 @@ ffs_statfs(mp, sbp)
return (0);
}
+static bool
+sync_doupdate(struct inode *ip)
+{
+
+ return ((ip->i_flag & (IN_ACCESS | IN_CHANGE | IN_MODIFIED |
+ IN_UPDATE)) != 0);
+}
+
/*
* For a lazy sync, we only care about access times, quotas and the
* superblock. Other filesystem changes are already converted to
@@ -1442,15 +1450,15 @@ ffs_sync_lazy(mp)
* Test also all the other timestamp flags too, to pick up
* any other cases that could be missed.
*/
- if ((ip->i_flag & (IN_ACCESS | IN_CHANGE | IN_MODIFIED |
- IN_UPDATE)) == 0) {
+ if (!sync_doupdate(ip) && (vp->v_iflag & VI_OWEINACT) == 0) {
VI_UNLOCK(vp);
continue;
}
if ((error = vget(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK,
td)) != 0)
continue;
- error = ffs_update(vp, 0);
+ if (sync_doupdate(ip))
+ error = ffs_update(vp, 0);
if (error != 0)
allerror = error;
vput(vp);
OpenPOWER on IntegriCloud