Sun Sep 21 23:22:01 2008 UTC ()
Revert previous, pooka@ points out it's wrong.


(freza)
diff -r1.235 -r1.236 src/sys/ufs/ffs/ffs_vfsops.c

cvs diff -r1.235 -r1.236 src/sys/ufs/ffs/ffs_vfsops.c (expand / switch to unified diff)

--- src/sys/ufs/ffs/ffs_vfsops.c 2008/09/21 21:08:22 1.235
+++ src/sys/ufs/ffs/ffs_vfsops.c 2008/09/21 23:22:00 1.236
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: ffs_vfsops.c,v 1.235 2008/09/21 21:08:22 freza Exp $ */ 1/* $NetBSD: ffs_vfsops.c,v 1.236 2008/09/21 23:22:00 freza Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2008 The NetBSD Foundation, Inc. 4 * Copyright (c) 2008 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Wasabi Systems, Inc. 8 * by Wasabi Systems, Inc.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -51,27 +51,27 @@ @@ -51,27 +51,27 @@
51 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 51 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
52 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 52 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
53 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 53 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
54 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 54 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
55 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 55 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
58 * SUCH DAMAGE. 58 * SUCH DAMAGE.
59 * 59 *
60 * @(#)ffs_vfsops.c 8.31 (Berkeley) 5/20/95 60 * @(#)ffs_vfsops.c 8.31 (Berkeley) 5/20/95
61 */ 61 */
62 62
63#include <sys/cdefs.h> 63#include <sys/cdefs.h>
64__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.235 2008/09/21 21:08:22 freza Exp $"); 64__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.236 2008/09/21 23:22:00 freza Exp $");
65 65
66#if defined(_KERNEL_OPT) 66#if defined(_KERNEL_OPT)
67#include "opt_ffs.h" 67#include "opt_ffs.h"
68#include "opt_quota.h" 68#include "opt_quota.h"
69#include "opt_softdep.h" 69#include "opt_softdep.h"
70#include "opt_wapbl.h" 70#include "opt_wapbl.h"
71#endif 71#endif
72 72
73#include <sys/param.h> 73#include <sys/param.h>
74#include <sys/systm.h> 74#include <sys/systm.h>
75#include <sys/namei.h> 75#include <sys/namei.h>
76#include <sys/proc.h> 76#include <sys/proc.h>
77#include <sys/kernel.h> 77#include <sys/kernel.h>
@@ -580,27 +580,27 @@ ffs_mount(struct mount *mp, const char * @@ -580,27 +580,27 @@ ffs_mount(struct mount *mp, const char *
580 */ 580 */
581 fs->fs_ronly = 0; 581 fs->fs_ronly = 0;
582 fs->fs_clean <<= 1; 582 fs->fs_clean <<= 1;
583 fs->fs_fmod = 1; 583 fs->fs_fmod = 1;
584 if ((fs->fs_flags & FS_DOSOFTDEP)) { 584 if ((fs->fs_flags & FS_DOSOFTDEP)) {
585 error = softdep_mount(devvp, mp, fs, 585 error = softdep_mount(devvp, mp, fs,
586 l->l_cred); 586 l->l_cred);
587 if (error) 587 if (error)
588 return (error); 588 return (error);
589 } 589 }
590#ifdef WAPBL 590#ifdef WAPBL
591 if (fs->fs_flags & FS_DOWAPBL) { 591 if (fs->fs_flags & FS_DOWAPBL) {
592 printf("%s: replaying log to disk\n", 592 printf("%s: replaying log to disk\n",
593 path); 593 fs->fs_fsmnt);
594 KDASSERT(mp->mnt_wapbl_replay); 594 KDASSERT(mp->mnt_wapbl_replay);
595 error = wapbl_replay_write(mp->mnt_wapbl_replay, 595 error = wapbl_replay_write(mp->mnt_wapbl_replay,
596 devvp); 596 devvp);
597 if (error) { 597 if (error) {
598 return error; 598 return error;
599 } 599 }
600 wapbl_replay_stop(mp->mnt_wapbl_replay); 600 wapbl_replay_stop(mp->mnt_wapbl_replay);
601 fs->fs_clean = FS_WASCLEAN; 601 fs->fs_clean = FS_WASCLEAN;
602 } 602 }
603#endif /* WAPBL */ 603#endif /* WAPBL */
604 if (fs->fs_snapinum[0] != 0) 604 if (fs->fs_snapinum[0] != 0)
605 ffs_snapshot_mount(mp); 605 ffs_snapshot_mount(mp);
606 } 606 }
@@ -1052,36 +1052,36 @@ ffs_mountfs(struct vnode *devvp, struct  @@ -1052,36 +1052,36 @@ ffs_mountfs(struct vnode *devvp, struct
1052 ffs_sb_swap((struct fs*)bp->b_data, fs); 1052 ffs_sb_swap((struct fs*)bp->b_data, fs);
1053 fs->fs_flags |= FS_SWAPPED; 1053 fs->fs_flags |= FS_SWAPPED;
1054 } else 1054 } else
1055#endif 1055#endif
1056 fs->fs_flags &= ~FS_SWAPPED; 1056 fs->fs_flags &= ~FS_SWAPPED;
1057 1057
1058#ifdef WAPBL 1058#ifdef WAPBL
1059 if ((mp->mnt_wapbl_replay == 0) && (fs->fs_flags & FS_DOWAPBL)) { 1059 if ((mp->mnt_wapbl_replay == 0) && (fs->fs_flags & FS_DOWAPBL)) {
1060 error = ffs_wapbl_replay_start(mp, fs, devvp); 1060 error = ffs_wapbl_replay_start(mp, fs, devvp);
1061 if (error) 1061 if (error)
1062 goto out; 1062 goto out;
1063 1063
1064 if (!ronly) { 1064 if (!ronly) {
1065 printf("%s: replaying log to disk\n", 1065 /* XXX fsmnt may be stale. */
1066 mp->mnt_stat.f_mntonname); 1066 printf("%s: replaying log to disk\n", fs->fs_fsmnt);
1067 error = wapbl_replay_write(mp->mnt_wapbl_replay, devvp); 1067 error = wapbl_replay_write(mp->mnt_wapbl_replay, devvp);
1068 if (error) 1068 if (error)
1069 goto out; 1069 goto out;
1070 wapbl_replay_stop(mp->mnt_wapbl_replay); 1070 wapbl_replay_stop(mp->mnt_wapbl_replay);
1071 fs->fs_clean = FS_WASCLEAN; 1071 fs->fs_clean = FS_WASCLEAN;
1072 } else { 1072 } else {
1073 printf("%s: replaying log to memory\n", 1073 /* XXX fsmnt may be stale */
1074 mp->mnt_stat.f_mntonname); 1074 printf("%s: replaying log to memory\n", fs->fs_fsmnt);
1075 } 1075 }
1076 1076
1077 /* Force a re-read of the superblock */ 1077 /* Force a re-read of the superblock */
1078 brelse(bp, BC_INVAL); 1078 brelse(bp, BC_INVAL);
1079 bp = NULL; 1079 bp = NULL;
1080 free(fs, M_UFSMNT); 1080 free(fs, M_UFSMNT);
1081 fs = NULL; 1081 fs = NULL;
1082 goto sbagain; 1082 goto sbagain;
1083 } 1083 }
1084#else /* !WAPBL */ 1084#else /* !WAPBL */
1085 if ((fs->fs_flags & FS_DOWAPBL) && (mp->mnt_flag & MNT_FORCE) == 0) { 1085 if ((fs->fs_flags & FS_DOWAPBL) && (mp->mnt_flag & MNT_FORCE) == 0) {
1086 error = EPERM; 1086 error = EPERM;
1087 goto out; 1087 goto out;