Merge tag 'nfs-for-4.8-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 12 Aug 2016 19:32:24 +0000 (12:32 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 12 Aug 2016 19:32:24 +0000 (12:32 -0700)
Pull NFS client bugfixes from Trond Myklebust:
 "Highlights include:

   - Stable patch from Olga to fix RPCSEC_GSS upcalls when the same user
     needs multiple different security services (e.g.  krb5i and krb5p).

   - Stable patch to fix a regression introduced by the use of
     SO_REUSEPORT, and that prevented the use of multiple different NFS
     versions to the same server.

   - TCP socket reconnection timer fixes.

   - Patch from Neil to disable the use of IPv6 temporary addresses"

* tag 'nfs-for-4.8-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
  NFSv4: Cap the transport reconnection timer at 1/2 lease period
  NFSv4: Cleanup the setting of the nfs4 lease period
  SUNRPC: Limit the reconnect backoff timer to the max RPC message timeout
  SUNRPC: Fix reconnection timeouts
  NFSv4.2: LAYOUTSTATS may return NFS4ERR_ADMIN/DELEG_REVOKED
  SUNRPC: disable the use of IPv6 temporary addresses.
  SUNRPC: allow for upcalls for same uid but different gss service
  SUNRPC: Fix up socket autodisconnect
  SUNRPC: Handle EADDRNOTAVAIL on connection failures

1  2 
fs/nfs/nfs4_fs.h
fs/nfs/nfs4proc.c

diff --combined fs/nfs/nfs4_fs.h
@@@ -225,8 -225,7 +225,8 @@@ int nfs_atomic_open(struct inode *, str
  extern struct file_system_type nfs4_fs_type;
  
  /* nfs4namespace.c */
 -struct rpc_clnt *nfs4_negotiate_security(struct rpc_clnt *, struct inode *, struct qstr *);
 +struct rpc_clnt *nfs4_negotiate_security(struct rpc_clnt *, struct inode *,
 +                                       const struct qstr *);
  struct vfsmount *nfs4_submount(struct nfs_server *, struct dentry *,
                               struct nfs_fh *, struct nfs_fattr *);
  int nfs4_replace_transport(struct nfs_server *server,
@@@ -253,7 -252,7 +253,7 @@@ extern int nfs4_proc_fs_locations(struc
  extern int nfs4_proc_get_locations(struct inode *, struct nfs4_fs_locations *,
                struct page *page, struct rpc_cred *);
  extern int nfs4_proc_fsid_present(struct inode *, struct rpc_cred *);
 -extern struct rpc_clnt *nfs4_proc_lookup_mountpoint(struct inode *, struct qstr *,
 +extern struct rpc_clnt *nfs4_proc_lookup_mountpoint(struct inode *, const struct qstr *,
                            struct nfs_fh *, struct nfs_fattr *);
  extern int nfs4_proc_secinfo(struct inode *, const struct qstr *, struct nfs4_secinfo_flavors *);
  extern const struct xattr_handler *nfs4_xattr_handlers[];
@@@ -396,6 -395,10 +396,10 @@@ extern void nfs4_schedule_state_renewal
  extern void nfs4_renewd_prepare_shutdown(struct nfs_server *);
  extern void nfs4_kill_renewd(struct nfs_client *);
  extern void nfs4_renew_state(struct work_struct *);
+ extern void nfs4_set_lease_period(struct nfs_client *clp,
+               unsigned long lease,
+               unsigned long lastrenewed);
  
  /* nfs4state.c */
  struct rpc_cred *nfs4_get_clid_cred(struct nfs_client *clp);
diff --combined fs/nfs/nfs4proc.c
@@@ -3538,7 -3538,7 +3538,7 @@@ static void nfs_fixup_secinfo_attribute
  }
  
  static int nfs4_proc_lookup_common(struct rpc_clnt **clnt, struct inode *dir,
 -                                 struct qstr *name, struct nfs_fh *fhandle,
 +                                 const struct qstr *name, struct nfs_fh *fhandle,
                                   struct nfs_fattr *fattr, struct nfs4_label *label)
  {
        struct nfs4_exception exception = { };
@@@ -3580,7 -3580,7 +3580,7 @@@ out
        return err;
  }
  
 -static int nfs4_proc_lookup(struct inode *dir, struct qstr *name,
 +static int nfs4_proc_lookup(struct inode *dir, const struct qstr *name,
                            struct nfs_fh *fhandle, struct nfs_fattr *fattr,
                            struct nfs4_label *label)
  {
  }
  
  struct rpc_clnt *
 -nfs4_proc_lookup_mountpoint(struct inode *dir, struct qstr *name,
 +nfs4_proc_lookup_mountpoint(struct inode *dir, const struct qstr *name,
                            struct nfs_fh *fhandle, struct nfs_fattr *fattr)
  {
        struct rpc_clnt *client = NFS_CLIENT(dir);
@@@ -3755,7 -3755,7 +3755,7 @@@ out
        return status;
  }
  
 -static int _nfs4_proc_remove(struct inode *dir, struct qstr *name)
 +static int _nfs4_proc_remove(struct inode *dir, const struct qstr *name)
  {
        struct nfs_server *server = NFS_SERVER(dir);
        struct nfs_removeargs args = {
        return status;
  }
  
 -static int nfs4_proc_remove(struct inode *dir, struct qstr *name)
 +static int nfs4_proc_remove(struct inode *dir, const struct qstr *name)
  {
        struct nfs4_exception exception = { };
        int err;
@@@ -3861,7 -3861,7 +3861,7 @@@ static int nfs4_proc_rename_done(struc
        return 1;
  }
  
 -static int _nfs4_proc_link(struct inode *inode, struct inode *dir, struct qstr *name)
 +static int _nfs4_proc_link(struct inode *inode, struct inode *dir, const struct qstr *name)
  {
        struct nfs_server *server = NFS_SERVER(inode);
        struct nfs4_link_arg arg = {
@@@ -3908,7 -3908,7 +3908,7 @@@ out
        return status;
  }
  
 -static int nfs4_proc_link(struct inode *inode, struct inode *dir, struct qstr *name)
 +static int nfs4_proc_link(struct inode *inode, struct inode *dir, const struct qstr *name)
  {
        struct nfs4_exception exception = { };
        int err;
@@@ -3930,7 -3930,7 +3930,7 @@@ struct nfs4_createdata 
  };
  
  static struct nfs4_createdata *nfs4_alloc_createdata(struct inode *dir,
 -              struct qstr *name, struct iattr *sattr, u32 ftype)
 +              const struct qstr *name, struct iattr *sattr, u32 ftype)
  {
        struct nfs4_createdata *data;
  
@@@ -4237,12 -4237,9 +4237,9 @@@ static int nfs4_do_fsinfo(struct nfs_se
                err = _nfs4_do_fsinfo(server, fhandle, fsinfo);
                trace_nfs4_fsinfo(server, fhandle, fsinfo->fattr, err);
                if (err == 0) {
-                       struct nfs_client *clp = server->nfs_client;
-                       spin_lock(&clp->cl_lock);
-                       clp->cl_lease_time = fsinfo->lease_time * HZ;
-                       clp->cl_last_renewal = now;
-                       spin_unlock(&clp->cl_lock);
+                       nfs4_set_lease_period(server->nfs_client,
+                                       fsinfo->lease_time * HZ,
+                                       now);
                        break;
                }
                err = nfs4_handle_exception(server, err, &exception);