Source-Changes-HG archive

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

[src/trunk]: src/sbin/mount_nfs Add -A (noac) option to turn off the attribut...



details:   https://anonhg.NetBSD.org/src/rev/e60b4f66c772
branches:  trunk
changeset: 1014806:e60b4f66c772
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Oct 03 18:06:37 2020 +0000

description:
Add -A (noac) option to turn off the attribute cache. (Maciej W. Rozycki)

diffstat:

 sbin/mount_nfs/mount_nfs.8 |  20 +++++++++++++++++---
 sbin/mount_nfs/mount_nfs.c |  11 +++++++++--
 2 files changed, 26 insertions(+), 5 deletions(-)

diffs (108 lines):

diff -r 6bf638468d8f -r e60b4f66c772 sbin/mount_nfs/mount_nfs.8
--- a/sbin/mount_nfs/mount_nfs.8        Sat Oct 03 17:33:23 2020 +0000
+++ b/sbin/mount_nfs/mount_nfs.8        Sat Oct 03 18:06:37 2020 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: mount_nfs.8,v 1.48 2018/05/17 06:37:06 wiz Exp $
+.\"    $NetBSD: mount_nfs.8,v 1.49 2020/10/03 18:06:37 christos Exp $
 .\"
 .\" Copyright (c) 1992, 1993, 1994, 1995
 .\"    The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"    @(#)mount_nfs.8 8.3 (Berkeley) 3/29/95
 .\"
-.Dd September 12, 2016
+.Dd October 3, 2020
 .Dt MOUNT_NFS 8
 .Os
 .Sh NAME
@@ -37,7 +37,7 @@
 .Nd mount NFS file systems
 .Sh SYNOPSIS
 .Nm
-.Op Fl 23bCcdilPpqsTUuX
+.Op Fl 23AbCcdilPpqsTUuX
 .Op Fl a Ar maxreadahead
 .Op Fl D Ar deadthresh
 .Op Fl g Ar maxgroups
@@ -75,6 +75,17 @@
 Use the NFS Version 3 protocol.
 The default is to try version 3 first, and
 fall back to version 2 if the mount fails.
+.It Fl A
+Disable the attribute cache in the client, making it consult the server
+for the current version of a given file's attributes every time the file
+is accessed.
+
+By default the attribute cache is enabled, making the client only consult
+the server every handful of seconds.  This improves performance, however
+at the cost of the risk of a mid-air collision when changes are made
+simultaneously by different NFS clients and/or locally on the NFS server
+that affect the same file.  In that case changes made elsewhere may be
+missed, leading to consistency issues.
 .It Fl a Ar maxreadahead
 Set the read-ahead count to the specified value.
 This may be in the range of 0 - 4, and determines how many blocks
@@ -186,6 +197,9 @@
 .It Cm nfsv3
 Same as
 .Fl 3 .
+.It Cm noac
+Same as
+.Fl A .
 .It Cm noresport
 Same as
 .Fl p .
diff -r 6bf638468d8f -r e60b4f66c772 sbin/mount_nfs/mount_nfs.c
--- a/sbin/mount_nfs/mount_nfs.c        Sat Oct 03 17:33:23 2020 +0000
+++ b/sbin/mount_nfs/mount_nfs.c        Sat Oct 03 18:06:37 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mount_nfs.c,v 1.72 2018/05/17 02:34:31 thorpej Exp $   */
+/*     $NetBSD: mount_nfs.c,v 1.73 2020/10/03 18:06:37 christos Exp $  */
 
 /*
  * Copyright (c) 1992, 1993, 1994
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "@(#)mount_nfs.c        8.11 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: mount_nfs.c,v 1.72 2018/05/17 02:34:31 thorpej Exp $");
+__RCSID("$NetBSD: mount_nfs.c,v 1.73 2020/10/03 18:06:37 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -79,6 +79,7 @@
 #define ALTF_CONN      0x00000002
 #define ALTF_DUMBTIMR  0x00000004
 #define ALTF_INTR      0x00000008
+#define ALTF_NOAC      0x00000010
 #define ALTF_NFSV3     0x00000020
 #define ALTF_RDIRPLUS  0x00000040
 #define        ALTF_MNTUDP     0x00000080
@@ -109,6 +110,7 @@
        { "conn", 0, ALTF_CONN, 1 },
        { "dumbtimer", 0, ALTF_DUMBTIMR, 1 },
        { "intr", 0, ALTF_INTR, 1 },
+       { "ac", 1, ALTF_NOAC, 1 },
        { "nfsv3", 0, ALTF_NFSV3, 1 },
        { "rdirplus", 0, ALTF_RDIRPLUS, 1 },
        { "mntudp", 0, ALTF_MNTUDP, 1 },
@@ -217,6 +219,9 @@
                        force2 = 1;
                        nfsargsp->flags &= ~NFSMNT_NFSV3;
                        break;
+               case 'A':
+                       nfsargsp->flags |= NFSMNT_NOAC;
+                       break;
                case 'a':
                        num = strtol(optarg, &p, 10);
                        if (*p || num < 0)
@@ -281,6 +286,8 @@
                                nfsargsp->flags |= NFSMNT_DUMBTIMR;
                        if (altflags & ALTF_INTR)
                                nfsargsp->flags |= NFSMNT_INT;
+                       if (altflags & ALTF_NOAC)
+                               nfsargsp->flags |= NFSMNT_NOAC;
                        if (altflags & (ALTF_NFSV3|ALTF_NQNFS)) {
                                if (force2)
                                        errx(1, "conflicting version options");



Home | Main Index | Thread Index | Old Index