1. 10 Mar, 2012 1 commit
    • Trond Myklebust's avatar
      NFSv4.0: Re-establish the callback channel on NFS4ERR_CB_PATHDOWN · ad1e3968
      Trond Myklebust authored
      When the NFSv4.0 server tells us that it can no-longer talk to us
      on the callback channel, we should attempt a new SETCLIENTID in
      order to re-transmit the callback channel information.
      
      Note that as long as we do not change the boot verifier, this is
      a safe procedure; the server is required to keep our state.
      
      Also move the function nfs_handle_cb_pathdown to fs/nfs/nfs4state.c,
      and change the name in order to mark it as being specific to NFSv4.0.
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      ad1e3968
  2. 09 Mar, 2012 2 commits
  3. 08 Mar, 2012 1 commit
  4. 07 Mar, 2012 5 commits
  5. 06 Mar, 2012 17 commits
  6. 05 Mar, 2012 2 commits
  7. 03 Mar, 2012 1 commit
  8. 02 Mar, 2012 11 commits
    • Chuck Lever's avatar
      NFS: Reduce debugging noise from encode_compound_hdr · 54b50af0
      Chuck Lever authored
      Get rid of
      
        encode_compound: tag=
      
      when XDR debugging is enabled.  The current Linux client never sets
      compound tags.
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      54b50af0
    • Chuck Lever's avatar
      NFS: Request fh_expire_type attribute in "server caps" operation · 264e6351
      Chuck Lever authored
      The fh_expire_type file attribute is a filesystem wide attribute that
      consists of flags that indicate what characteristics file handles
      on this FSID have.
      
      Our client doesn't support volatile file handles.  It should find
      out early (say, at mount time) whether the server is going to play
      shenanighans with file handles during a migration.
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      264e6351
    • Chuck Lever's avatar
      NFS: Introduce NFS_ATTR_FATTR_V4_LOCATIONS · 81934ddb
      Chuck Lever authored
      The Linux NFS client must distinguish between referral events (which
      it currently supports) and migration events (which it does not yet
      support).
      
      In both types of events, an fs_locations array is returned.  But upper
      layers, not the XDR layer, should make the distinction between a
      referral and a migration.  There really isn't a way for an XDR decoder
      function to distinguish the two, in general.
      
      Slightly adjust the FATTR flags returned by decode_fs_locations()
      to set NFS_ATTR_FATTR_V4_LOCATIONS only if a non-empty locations
      array was returned from the server.  Then have logic in nfs4proc.c
      distinguish whether the locations array is for a referral or
      something else.
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      81934ddb
    • Chuck Lever's avatar
      NFS: Simplify arguments of encode_renew() · bb4dae5e
      Chuck Lever authored
      Clean up: pass just the clientid4 to encode_renew().  This enables it
      to be used by callers who might not have an full nfs_client.
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      bb4dae5e
    • Chuck Lever's avatar
      NFS: Add a client-side function to display NFS file handles · 20d27e92
      Chuck Lever authored
      For debugging, introduce a simplistic function to print NFS file
      handles on the system console.  The main function is hooked into the
      dprintk debugging facility, but you can directly call the helper,
      _nfs_display_fhandle(), if you want to print a handle unconditionally.
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      20d27e92
    • Chuck Lever's avatar
      NFS: Make clientaddr= optional · 31b8e2ae
      Chuck Lever authored
      For NFSv4 mounts, the clientaddr= mount option has always been
      required.  Now we have rpc_localaddr() in the kernel, which was
      modeled after the same logic in the mount.nfs command that constructs
      the clientaddr= mount option.  If user space doesn't provide a
      clientaddr= mount option, the kernel can now construct its own.
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      31b8e2ae
    • Chuck Lever's avatar
      SUNRPC: Add API to acquire source address · 2e738fdc
      Chuck Lever authored
      NFSv4.0 clients must send endpoint information for their callback
      service to NFSv4.0 servers during their first contact with a server.
      Traditionally on Linux, user space provides the callback endpoint IP
      address via the "clientaddr=" mount option.
      
      During an NFSv4 migration event, it is possible that an FSID may be
      migrated to a destination server that is accessible via a different
      source IP address than the source server was.  The client must update
      callback endpoint information on the destination server so that it can
      maintain leases and allow delegation.
      
      Without a new "clientaddr=" option from user space, however, the
      kernel itself must construct an appropriate IP address for the
      callback update.  Provide an API in the RPC client for upper layer
      RPC consumers to acquire a source address for a remote.
      
      The mechanism used by the mount.nfs command is copied: set up a
      connected UDP socket to the designated remote, then scrape the source
      address off the socket.  We are careful to select the correct network
      namespace when setting up the temporary UDP socket.
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      2e738fdc
    • Trond Myklebust's avatar
      SUNRPC: Move clnt->cl_server into struct rpc_xprt · 4e0038b6
      Trond Myklebust authored
      When the cl_xprt field is updated, the cl_server field will also have
      to change.  Since the contents of cl_server follow the remote endpoint
      of cl_xprt, just move that field to the rpc_xprt.
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      [ cel: simplify check_gss_callback_principal(), whitespace changes ]
      [ cel: forward ported to 3.4 ]
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      4e0038b6
    • Trond Myklebust's avatar
      SUNRPC: Use RCU to dereference the rpc_clnt.cl_xprt field · 2446ab60
      Trond Myklebust authored
      A migration event will replace the rpc_xprt used by an rpc_clnt.  To
      ensure this can be done safely, all references to cl_xprt must now use
      a form of rcu_dereference().
      
      Special care is taken with rpc_peeraddr2str(), which returns a pointer
      to memory whose lifetime is the same as the rpc_xprt.
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      [ cel: fix lockdep splats and layering violations ]
      [ cel: forward ported to 3.4 ]
      [ cel: remove rpc_max_reqs(), add rpc_net_ns() ]
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      2446ab60
    • Chuck Lever's avatar
      NFS: Add debugging messages to NFSv4's CLOSE procedure · a3ca5651
      Chuck Lever authored
      CLOSE is new with NFSv4.  Sometimes it's important to know the timing
      of this operation compared to things like lease renewal.
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      a3ca5651
    • Chuck Lever's avatar
      NFS: Clean up debugging in decode_pathname() · 02a2976c
      Chuck Lever authored
      I noticed recently that decode_attr_fs_locations() is not generating
      very pretty debugging output.  The pathname components each appear on
      a separate line of output, though that does not appear to be the
      intended display behavior.  The preferred way to generate continued
      lines of output on the console is to use pr_cont().
      
      Note that incoming pathname4 components contain a string that is not
      necessarily NUL-terminated.  I did actually see some trailing garbage
      on the console.  In addition to correcting the line continuation
      problem, add a string precision format specifier to ensure that each
      component string is displayed properly, and that vsnprintf() does
      not Oops.
      
      Someone pointed out that allowing incoming network data to possibly
      generate a console line of unbounded length may not be such a good
      idea.  Since this output will rarely be enabled, and there is a hard
      upper bound (NFS4_PATHNAME_MAXCOMPONENTS) in our implementation, this
      is probably not a major concern.
      
      It might be useful to additionally sanity-check the length of each
      incoming component, however.  RFC 3530bis15 does not suggest a maximum
      number of UTF-8 characters per component for either the pathname4 or
      component4 types.  However, we could invent one that is appropriate
      for our implementation.
      
      Another possibility is to scrap all of this and print these pathnames
      in upper layers after a reasonable amount of sanity checking in the
      XDR layer.  This would give us an opportunity to allocate a full
      buffer so that the whole pathname would be output via a single
      dprintk.
      
      Introduced by commit 7aaa0b3b: "NFSv4: convert fs-locations-components
      to conform to RFC3530," (June 9, 2006).
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      02a2976c