Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/ufs/ffs need to turn off async during ffs_sync(), otherw...
details: https://anonhg.NetBSD.org/src/rev/a244a73aee30
branches: trunk
changeset: 352114:a244a73aee30
user: jdolecek <jdolecek%NetBSD.org@localhost>
date: Thu Mar 16 22:09:19 2017 +0000
description:
need to turn off async during ffs_sync(), otherwise its bwrite() calls are
themselves turned to bdwrite(), creating dirty delayed writes
fixes panic for 'mount -o log,async ...' reported by Masanobu SAITOH
on current-users; fix help by hannken@, thank you
diffstat:
sys/ufs/ffs/ffs_wapbl.c | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diffs (37 lines):
diff -r 38a7a52437d6 -r a244a73aee30 sys/ufs/ffs/ffs_wapbl.c
--- a/sys/ufs/ffs/ffs_wapbl.c Thu Mar 16 16:32:12 2017 +0000
+++ b/sys/ufs/ffs/ffs_wapbl.c Thu Mar 16 22:09:19 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ffs_wapbl.c,v 1.38 2017/03/10 22:43:03 jdolecek Exp $ */
+/* $NetBSD: ffs_wapbl.c,v 1.39 2017/03/16 22:09:19 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.38 2017/03/10 22:43:03 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_wapbl.c,v 1.39 2017/03/16 22:09:19 jdolecek Exp $");
#define WAPBL_INTERNAL
@@ -340,10 +340,16 @@
/*
* Make sure we don't carry over any delayed write
- * buffers when updating to log.
+ * buffers when updating to log. Need to turn off
+ * async termporarily, to prevent ffs_sync() writes
+ * themselves being turned into delayed writes.
*/
- if (mp->mnt_flag & MNT_UPDATE)
+ if (mp->mnt_flag & MNT_UPDATE) {
+ int saveflag = mp->mnt_flag & MNT_ASYNC;
+ mp->mnt_flag &= ~MNT_ASYNC;
ffs_sync(mp, MNT_WAIT, FSCRED);
+ mp->mnt_flag |= saveflag;
+ }
error = wapbl_log_position(mp, fs, devvp, &off,
&count, &blksize, &extradata);
Home |
Main Index |
Thread Index |
Old Index