Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/ufs/ffs sync any delayed writes when updating filesystem...



details:   https://anonhg.NetBSD.org/src/rev/9e2834131fe0
branches:  trunk
changeset: 352023:9e2834131fe0
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Fri Mar 10 22:43:03 2017 +0000

description:
sync any delayed writes when updating filesystem to log

Adresses PR kern/52056 by Martin Husemann, fix helped by Juergen Hannken, thanks

diffstat:

 sys/ufs/ffs/ffs_wapbl.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (32 lines):

diff -r ba84b087ef3c -r 9e2834131fe0 sys/ufs/ffs/ffs_wapbl.c
--- a/sys/ufs/ffs/ffs_wapbl.c   Fri Mar 10 20:38:28 2017 +0000
+++ b/sys/ufs/ffs/ffs_wapbl.c   Fri Mar 10 22:43:03 2017 +0000
@@ -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 @@
                                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)



Home | Main Index | Thread Index | Old Index