]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Merge branch 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 18 Aug 2010 22:45:23 +0000 (15:45 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 18 Aug 2010 22:45:23 +0000 (15:45 -0700)
* 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6:
  NFS: Fix an Oops in the NFSv4 atomic open code
  NFS: Fix the selection of security flavours in Kconfig
  NFS: fix the return value of nfs_file_fsync()
  rpcrdma: Fix SQ size calculation when memreg is FRMR
  xprtrdma: Do not truncate iova_start values in frmr registrations.
  nfs: Remove redundant NULL check upon kfree()
  nfs: Add "lookupcache" to displayed mount options
  NFS: allow close-to-open cache semantics to apply to root of NFS filesystem
  SUNRPC: fix NFS client over TCP hangs due to packet loss (Bug 16494)

1  2 
fs/nfs/Kconfig
fs/nfs/super.c
net/sunrpc/xprtsock.c

diff --combined fs/nfs/Kconfig
index 26a510a7be0908023eaa5848002eced097f6e9dc,2ddc384ec0428466e48f5f835bc5c84ddd960eb3..6c2aad49d7318054b57c22b58c6b4eaa0be50178
@@@ -63,7 -63,6 +63,6 @@@ config NFS_V3_AC
  config NFS_V4
        bool "NFS client support for NFS version 4"
        depends on NFS_FS
-       select RPCSEC_GSS_KRB5
        help
          This option enables support for version 4 of the NFS protocol
          (RFC 3530) in the kernel's NFS client.
@@@ -100,20 -99,3 +99,20 @@@ config NFS_FSCACH
        help
          Say Y here if you want NFS data to be cached locally on disc through
          the general filesystem cache manager
 +
 +config NFS_USE_LEGACY_DNS
 +      bool "Use the legacy NFS DNS resolver"
 +      depends on NFS_V4
 +      help
 +        The kernel now provides a method for translating a host name into an
 +        IP address.  Select Y here if you would rather use your own DNS
 +        resolver script.
 +
 +        If unsure, say N
 +
 +config NFS_USE_KERNEL_DNS
 +      bool
 +      depends on NFS_V4 && !NFS_USE_LEGACY_DNS
 +      select DNS_RESOLVER
 +      select KEYS
 +      default y
diff --combined fs/nfs/super.c
index ee26316ad1f44eaf276299740c2a579635682fac,3d0d63c00304e497e302875259049cd04e293ce2..ec3966e4706b2f70d8709199f86456392a6e6584
@@@ -270,7 -270,7 +270,7 @@@ static const struct super_operations nf
        .write_inode    = nfs_write_inode,
        .put_super      = nfs_put_super,
        .statfs         = nfs_statfs,
 -      .clear_inode    = nfs_clear_inode,
 +      .evict_inode    = nfs_evict_inode,
        .umount_begin   = nfs_umount_begin,
        .show_options   = nfs_show_options,
        .show_stats     = nfs_show_stats,
@@@ -340,7 -340,7 +340,7 @@@ static const struct super_operations nf
        .write_inode    = nfs_write_inode,
        .put_super      = nfs_put_super,
        .statfs         = nfs_statfs,
 -      .clear_inode    = nfs4_clear_inode,
 +      .evict_inode    = nfs4_evict_inode,
        .umount_begin   = nfs_umount_begin,
        .show_options   = nfs_show_options,
        .show_stats     = nfs_show_stats,
@@@ -655,6 -655,13 +655,13 @@@ static void nfs_show_mount_options(stru
  
        if (nfss->options & NFS_OPTION_FSCACHE)
                seq_printf(m, ",fsc");
+       if (nfss->flags & NFS_MOUNT_LOOKUP_CACHE_NONEG) {
+               if (nfss->flags & NFS_MOUNT_LOOKUP_CACHE_NONE)
+                       seq_printf(m, ",lookupcache=none");
+               else
+                       seq_printf(m, ",lookupcache=pos");
+       }
  }
  
  /*
diff --combined net/sunrpc/xprtsock.c
index 49a62f0c4b87dc7f5a92223a7ecf67699e246e37,66d136984d57f1d767d6ddb7189db96e4cf06b2a..b6309db5622689deaf1c76a6acb1f6a09a02602c
@@@ -1305,10 -1305,11 +1305,11 @@@ static void xs_tcp_state_change(struct 
        if (!(xprt = xprt_from_sock(sk)))
                goto out;
        dprintk("RPC:       xs_tcp_state_change client %p...\n", xprt);
-       dprintk("RPC:       state %x conn %d dead %d zapped %d\n",
+       dprintk("RPC:       state %x conn %d dead %d zapped %d sk_shutdown %d\n",
                        sk->sk_state, xprt_connected(xprt),
                        sock_flag(sk, SOCK_DEAD),
-                       sock_flag(sk, SOCK_ZAPPED));
+                       sock_flag(sk, SOCK_ZAPPED),
+                       sk->sk_shutdown);
  
        switch (sk->sk_state) {
        case TCP_ESTABLISHED:
@@@ -1779,10 -1780,25 +1780,25 @@@ static void xs_tcp_reuse_connection(str
  {
        unsigned int state = transport->inet->sk_state;
  
-       if (state == TCP_CLOSE && transport->sock->state == SS_UNCONNECTED)
-               return;
-       if ((1 << state) & (TCPF_ESTABLISHED|TCPF_SYN_SENT))
-               return;
+       if (state == TCP_CLOSE && transport->sock->state == SS_UNCONNECTED) {
+               /* we don't need to abort the connection if the socket
+                * hasn't undergone a shutdown
+                */
+               if (transport->inet->sk_shutdown == 0)
+                       return;
+               dprintk("RPC:       %s: TCP_CLOSEd and sk_shutdown set to %d\n",
+                               __func__, transport->inet->sk_shutdown);
+       }
+       if ((1 << state) & (TCPF_ESTABLISHED|TCPF_SYN_SENT)) {
+               /* we don't need to abort the connection if the socket
+                * hasn't undergone a shutdown
+                */
+               if (transport->inet->sk_shutdown == 0)
+                       return;
+               dprintk("RPC:       %s: ESTABLISHED/SYN_SENT "
+                               "sk_shutdown set to %d\n",
+                               __func__, transport->inet->sk_shutdown);
+       }
        xs_abort_connection(xprt, transport);
  }
  
@@@ -2577,8 -2593,7 +2593,8 @@@ void cleanup_socket_xprt(void
        xprt_unregister_transport(&xs_bc_tcp_transport);
  }
  
 -static int param_set_uint_minmax(const char *val, struct kernel_param *kp,
 +static int param_set_uint_minmax(const char *val,
 +              const struct kernel_param *kp,
                unsigned int min, unsigned int max)
  {
        unsigned long num;
        return 0;
  }
  
 -static int param_set_portnr(const char *val, struct kernel_param *kp)
 +static int param_set_portnr(const char *val, const struct kernel_param *kp)
  {
        return param_set_uint_minmax(val, kp,
                        RPC_MIN_RESVPORT,
                        RPC_MAX_RESVPORT);
  }
  
 -static int param_get_portnr(char *buffer, struct kernel_param *kp)
 -{
 -      return param_get_uint(buffer, kp);
 -}
 +static struct kernel_param_ops param_ops_portnr = {
 +      .set = param_set_portnr,
 +      .get = param_get_uint,
 +};
 +
  #define param_check_portnr(name, p) \
        __param_check(name, p, unsigned int);
  
  module_param_named(min_resvport, xprt_min_resvport, portnr, 0644);
  module_param_named(max_resvport, xprt_max_resvport, portnr, 0644);
  
 -static int param_set_slot_table_size(const char *val, struct kernel_param *kp)
 +static int param_set_slot_table_size(const char *val,
 +                                   const struct kernel_param *kp)
  {
        return param_set_uint_minmax(val, kp,
                        RPC_MIN_SLOT_TABLE,
                        RPC_MAX_SLOT_TABLE);
  }
  
 -static int param_get_slot_table_size(char *buffer, struct kernel_param *kp)
 -{
 -      return param_get_uint(buffer, kp);
 -}
 +static struct kernel_param_ops param_ops_slot_table_size = {
 +      .set = param_set_slot_table_size,
 +      .get = param_get_uint,
 +};
 +
  #define param_check_slot_table_size(name, p) \
        __param_check(name, p, unsigned int);