From owner-svn-src-stable@FreeBSD.ORG Sun May 1 02:36:09 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A28EF106566B; Sun, 1 May 2011 02:36:09 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 902C68FC17; Sun, 1 May 2011 02:36:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p412a9ZC072750; Sun, 1 May 2011 02:36:09 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p412a9VI072747; Sun, 1 May 2011 02:36:09 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105010236.p412a9VI072747@svn.freebsd.org> From: Rick Macklem Date: Sun, 1 May 2011 02:36:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221291 - in stable/8/sys/fs: nfs nfsclient X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 May 2011 02:36:09 -0000 Author: rmacklem Date: Sun May 1 02:36:09 2011 New Revision: 221291 URL: http://svn.freebsd.org/changeset/base/221291 Log: MFC: r220739 Change some defaults in the experimental NFS client to be the same as the regular NFS client for NFSv3. The main one is making use of a reserved port# the default. Also, set the retry limit for TCP the same and fix the code so that it doesn't disable readdirplus for NFSv4. Modified: stable/8/sys/fs/nfs/nfs.h stable/8/sys/fs/nfsclient/nfs_clvfsops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfs/nfs.h ============================================================================== --- stable/8/sys/fs/nfs/nfs.h Sun May 1 02:22:54 2011 (r221290) +++ stable/8/sys/fs/nfs/nfs.h Sun May 1 02:36:09 2011 (r221291) @@ -56,6 +56,7 @@ #define NFSV4_UPCALLRETRY 4 /* Number of retries before failure */ #define NFS_MAXWINDOW 1024 /* Max number of outstanding requests */ #define NFS_RETRANS 10 /* Num of retrans for soft mounts */ +#define NFS_RETRANS_TCP 2 /* Num of retrans for TCP soft mounts */ #define NFS_MAXGRPS 16 /* Max. size of groups list */ #define NFS_TRYLATERDEL 15 /* Maximum delay timeout (sec) */ #ifndef NFS_REMOVETIMEO Modified: stable/8/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clvfsops.c Sun May 1 02:22:54 2011 (r221290) +++ stable/8/sys/fs/nfsclient/nfs_clvfsops.c Sun May 1 02:36:09 2011 (r221291) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -556,14 +557,29 @@ nfs_decode_args(struct mount *mp, struct if (argp->sotype == SOCK_STREAM) { nmp->nm_flag &= ~NFSMNT_NOCONN; nmp->nm_timeo = NFS_MAXTIMEO; + if ((argp->flags & NFSMNT_NFSV4) != 0) + nmp->nm_retry = INT_MAX; + else + nmp->nm_retry = NFS_RETRANS_TCP; } - /* Also clear RDIRPLUS if not NFSv3, it crashes some servers */ - if ((argp->flags & NFSMNT_NFSV3) == 0) + /* Also clear RDIRPLUS if NFSv2, it crashes some servers */ + if ((argp->flags & (NFSMNT_NFSV3 | NFSMNT_NFSV4)) == 0) { + argp->flags &= ~NFSMNT_RDIRPLUS; nmp->nm_flag &= ~NFSMNT_RDIRPLUS; + } + + /* Clear NFSMNT_RESVPORT for NFSv4, since it is not required. */ + if ((argp->flags & NFSMNT_NFSV4) != 0) { + argp->flags &= ~NFSMNT_RESVPORT; + nmp->nm_flag &= ~NFSMNT_RESVPORT; + } + /* Re-bind if rsrvd port requested and wasn't on one */ + adjsock = !(nmp->nm_flag & NFSMNT_RESVPORT) + && (argp->flags & NFSMNT_RESVPORT); /* Also re-bind if we're switching to/from a connected UDP socket */ - adjsock = ((nmp->nm_flag & NFSMNT_NOCONN) != + adjsock |= ((nmp->nm_flag & NFSMNT_NOCONN) != (argp->flags & NFSMNT_NOCONN)); /* Update flags atomically. Don't change the lock bits. */ @@ -708,7 +724,7 @@ nfs_mount(struct mount *mp) .proto = 0, .fh = NULL, .fhsize = 0, - .flags = 0, + .flags = NFSMNT_RESVPORT, .wsize = NFS_WSIZE, .rsize = NFS_RSIZE, .readdirsize = NFS_READDIRSIZE,