Source-Changes-HG archive

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

[src/netbsd-3]: src/sys/ufs/ffs Pull up revision 1.13 (requested by hannken i...



details:   https://anonhg.NetBSD.org/src/rev/70bcdb777135
branches:  netbsd-3
changeset: 575539:70bcdb777135
user:      tron <tron%NetBSD.org@localhost>
date:      Mon Apr 25 13:37:23 2005 +0000

description:
Pull up revision 1.13 (requested by hannken in ticket #197):
Fix an inconsistency where the last block of the snapshot contains old data.
The last block of the file system is written to the snapshot before the
file system is suspended.  If the last cylinder group is modified after
the file system is suspended the last block of the snapshot may contain
old data.  So update this block again.

diffstat:

 sys/ufs/ffs/ffs_snapshot.c |  12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diffs (29 lines):

diff -r eecb2699c376 -r 70bcdb777135 sys/ufs/ffs/ffs_snapshot.c
--- a/sys/ufs/ffs/ffs_snapshot.c        Mon Apr 25 13:36:24 2005 +0000
+++ b/sys/ufs/ffs/ffs_snapshot.c        Mon Apr 25 13:37:23 2005 +0000
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_snapshot.c,v 1.11.2.1 2005/04/25 13:36:24 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_snapshot.c,v 1.11.2.2 2005/04/25 13:37:23 tron Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -292,6 +292,16 @@
        vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
        microtime(&starttime);
        /*
+        * If the last cylinder group has changed the last block
+        * saved before may have changed too so update it now.
+        */
+       if (!ACTIVECG_ISSET(fs, fs->fs_ncg-1)) {
+               if ((error = readfsblk(vp, cgbuf, numblks - 1)) != 0)
+                       goto out1;
+               if ((error = writevnblk(vp, cgbuf, numblks - 1)) != 0)
+                       goto out1;
+       }
+       /*
         * First, copy all the cylinder group maps that have changed.
         */
        for (cg = 0; cg < fs->fs_ncg; cg++) {



Home | Main Index | Thread Index | Old Index