Mon Mar 6 10:12:00 2017 UTC ()
Adapt the test "enable WAPBL on rw mounts only" to the recent change of
the protocol to update a mounted file.

Should fix PR kern/52031 (FFS mount update doesn't play nice with WAPBL)


(hannken)
diff -r1.348 -r1.349 src/sys/ufs/ffs/ffs_vfsops.c

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

--- src/sys/ufs/ffs/ffs_vfsops.c 2017/03/01 10:46:43 1.348
+++ src/sys/ufs/ffs/ffs_vfsops.c 2017/03/06 10:12:00 1.349
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: ffs_vfsops.c,v 1.348 2017/03/01 10:46:43 hannken Exp $ */ 1/* $NetBSD: ffs_vfsops.c,v 1.349 2017/03/06 10:12:00 hannken Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. 4 * Copyright (c) 2008, 2009 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, and by Andrew Doran. 8 * by Wasabi Systems, Inc, and by Andrew Doran.
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.348 2017/03/01 10:46:43 hannken Exp $"); 64__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.349 2017/03/06 10:12:00 hannken 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_wapbl.h" 69#include "opt_wapbl.h"
70#endif 70#endif
71 71
72#include <sys/param.h> 72#include <sys/param.h>
73#include <sys/systm.h> 73#include <sys/systm.h>
74#include <sys/namei.h> 74#include <sys/namei.h>
75#include <sys/proc.h> 75#include <sys/proc.h>
76#include <sys/kernel.h> 76#include <sys/kernel.h>
77#include <sys/vnode.h> 77#include <sys/vnode.h>
@@ -508,27 +508,28 @@ ffs_mount(struct mount *mp, const char * @@ -508,27 +508,28 @@ ffs_mount(struct mount *mp, const char *
508 if (error) { 508 if (error) {
509 DPRINTF("kauth returned %d", error); 509 DPRINTF("kauth returned %d", error);
510 } 510 }
511 VOP_UNLOCK(devvp); 511 VOP_UNLOCK(devvp);
512 } 512 }
513 513
514 if (error) { 514 if (error) {
515 vrele(devvp); 515 vrele(devvp);
516 return (error); 516 return (error);
517 } 517 }
518 518
519#ifdef WAPBL 519#ifdef WAPBL
520 /* WAPBL can only be enabled on a r/w mount. */ 520 /* WAPBL can only be enabled on a r/w mount. */
521 if ((mp->mnt_flag & MNT_RDONLY) && !(mp->mnt_iflag & IMNT_WANTRDWR)) { 521 if (((mp->mnt_flag & MNT_RDONLY) && !(mp->mnt_iflag & IMNT_WANTRDWR)) ||
 522 (mp->mnt_iflag & IMNT_WANTRDONLY)) {
522 mp->mnt_flag &= ~MNT_LOG; 523 mp->mnt_flag &= ~MNT_LOG;
523 } 524 }
524#else /* !WAPBL */ 525#else /* !WAPBL */
525 mp->mnt_flag &= ~MNT_LOG; 526 mp->mnt_flag &= ~MNT_LOG;
526#endif /* !WAPBL */ 527#endif /* !WAPBL */
527 528
528 if (!update) { 529 if (!update) {
529 int xflags; 530 int xflags;
530 531
531 if (mp->mnt_flag & MNT_RDONLY) 532 if (mp->mnt_flag & MNT_RDONLY)
532 xflags = FREAD; 533 xflags = FREAD;
533 else 534 else
534 xflags = FREAD | FWRITE; 535 xflags = FREAD | FWRITE;