sync any delayed writes when updating filesystem to log

Adresses PR kern/52056 by Martin Husemann, fix helped by Juergen Hannken, thanks
This commit is contained in:
jdolecek 2017-03-10 22:43:03 +00:00
parent 03b219b5e7
commit 61d1aa6aec
1 changed files with 9 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ffs_wapbl.c,v 1.37 2016/11/10 22:19:23 jdolecek Exp $ */
/* $NetBSD: ffs_wapbl.c,v 1.38 2017/03/10 22:43:03 jdolecek Exp $ */
/*-
* Copyright (c) 2003,2006,2008 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ffs_wapbl.c,v 1.37 2016/11/10 22:19:23 jdolecek Exp $");
__KERNEL_RCSID(0, "$NetBSD: ffs_wapbl.c,v 1.38 2017/03/10 22:43:03 jdolecek Exp $");
#define WAPBL_INTERNAL
@ -338,6 +338,13 @@ ffs_wapbl_start(struct mount *mp)
return EINVAL;
}
/*
* Make sure we don't carry over any delayed write
* buffers when updating to log.
*/
if (mp->mnt_flag & MNT_UPDATE)
ffs_sync(mp, MNT_WAIT, FSCRED);
error = wapbl_log_position(mp, fs, devvp, &off,
&count, &blksize, &extradata);
if (error)