1. 03 3月, 2012 10 次提交
    • C
      NFS: Make clientaddr= optional · 31b8e2ae
      Chuck Lever 提交于
      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: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      31b8e2ae
    • C
      SUNRPC: Add API to acquire source address · 2e738fdc
      Chuck Lever 提交于
      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: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      2e738fdc
    • T
      SUNRPC: Move clnt->cl_server into struct rpc_xprt · 4e0038b6
      Trond Myklebust 提交于
      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: NTrond Myklebust <Trond.Myklebust@netapp.com>
      [ cel: simplify check_gss_callback_principal(), whitespace changes ]
      [ cel: forward ported to 3.4 ]
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      4e0038b6
    • T
      SUNRPC: Use RCU to dereference the rpc_clnt.cl_xprt field · 2446ab60
      Trond Myklebust 提交于
      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: NTrond 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: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      2446ab60
    • C
      NFS: Add debugging messages to NFSv4's CLOSE procedure · a3ca5651
      Chuck Lever 提交于
      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: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      a3ca5651
    • C
      NFS: Clean up debugging in decode_pathname() · 02a2976c
      Chuck Lever 提交于
      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: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      02a2976c
    • C
      NFS: Make nfs_cache_array.size a signed integer · 88b8e133
      Chuck Lever 提交于
      Eliminate a number of implicit type casts in comparisons, and these
      compiler warnings:
      
      fs/nfs/dir.c: In function ‘nfs_readdir_clear_array’:
      fs/nfs/dir.c:264:16: warning: comparison between signed and unsigned
      		integer expressions [-Wsign-compare]
      fs/nfs/dir.c: In function ‘nfs_readdir_search_for_cookie’:
      fs/nfs/dir.c:352:16: warning: comparison between signed and unsigned
      		integer expressions [-Wsign-compare]
      fs/nfs/dir.c: In function ‘nfs_do_filldir’:
      fs/nfs/dir.c:769:38: warning: comparison between signed and unsigned
      		integer expressions [-Wsign-compare]
      fs/nfs/dir.c:780:9: warning: comparison between signed and unsigned
      		integer expressions [-Wsign-compare]
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      88b8e133
    • T
    • T
      NFS: Ensure we display the minor version correctly in /proc/mounts etc. · 7bbceb6f
      Trond Myklebust 提交于
      The 'minorversion' mount option is now deprecated, so we need to display
      the minor version number in the 'vers=' format.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      7bbceb6f
    • T
      NFS: Extend the -overs= mount option to allow 4.x minorversions · 0d71b058
      Trond Myklebust 提交于
      Allow the user to mount an NFSv4.0 or NFSv4.1 partition using a
      standard syntax of '-overs=4.0', or '-overs=4.1' rather than the
      more cumbersome '-overs=4,minorversion=1'.
      
      See also the earlier patch by Dros Adamson, which added the
      Linux-specific syntax '-ov4.0', '-ov4.1'.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      0d71b058
  2. 02 3月, 2012 7 次提交
  3. 28 2月, 2012 4 次提交
    • S
      SUNRPC: move waitq from RPC pipe to RPC inode · 591ad7fe
      Stanislav Kinsbursky 提交于
      Currently, wait queue, used for polling of RPC pipe changes from user-space,
      is a part of RPC pipe. But the pipe data itself can be released on NFS umount
      prior to dentry-inode pair, connected to it (is case of this pair is open by
      some process).
      This is not a problem for almost all pipe users, because all PipeFS file
      operations checks pipe reference prior to using it.
      Except evenfd. This thing registers itself with "poll" file operation and thus
      has a reference to pipe wait queue. This leads to oopses on destroying eventfd
      after NFS umount (like rpc_idmapd do) since not pipe data left to the point
      already.
      The solution is to wait queue from pipe data to internal RPC inode data. This
      looks more logical, because this wiat queue used only for user-space processes,
      which already holds inode reference.
      
      Note: upcalls have to get pipe->dentry prior to dereferecing wait queue to make
      sure, that mount point won't disappear from underneath us.
      Signed-off-by: NStanislav Kinsbursky <skinsbursky@parallels.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      591ad7fe
    • S
      SUNRPC: check RPC inode's pipe reference before dereferencing · 2c9030ee
      Stanislav Kinsbursky 提交于
      There are 2 tightly bound objects: pipe data (created for kernel needs, has
      reference to dentry, which depends on PipeFS mount/umount) and PipeFS
      dentry/inode pair (created on mount for user-space needs). They both
      independently may have or have not a valid reference to each other.
      This means, that we have to make sure, that pipe->dentry reference is valid on
      upcalls, and dentry->pipe reference is valid on downcalls. The latter check is
      absent - my fault.
      IOW, PipeFS dentry can be opened by some process (rpc.idmapd for example), but
      it's pipe data can belong to NFS mount, which was unmounted already and thus
      pipe data was destroyed.
      To fix this, pipe reference have to be set to NULL on rpc_unlink() and checked
      on PipeFS file operations instead of pipe->dentry check.
      
      Note: PipeFS "poll" file operation will be updated in next patch, because it's
      logic is more complicated.
      Signed-off-by: NStanislav Kinsbursky <skinsbursky@parallels.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      2c9030ee
    • S
      NFS: release per-net clients lock before calling PipeFS dentries creation · e9dbca8d
      Stanislav Kinsbursky 提交于
      v3:
      1) Lookup for client is performed from the beginning of the list on each PipeFS
      event handling operation.
      
      Lockdep is sad otherwise, because inode mutex is taken on PipeFS dentry
      creation, which can be called on mount notification, where this per-net client
      lock is taken on clients list walk.
      Signed-off-by: NStanislav Kinsbursky <skinsbursky@parallels.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      e9dbca8d
    • S
      SUNRPC: release per-net clients lock before calling PipeFS dentries creation · da3b4622
      Stanislav Kinsbursky 提交于
      v3:
      1) Lookup for client is performed from the beginning of the list on each PipeFS
      event handling operation.
      
      Lockdep is sad otherwise, because inode mutex is taken on PipeFS dentry
      creation, which can be called on mount notification, where this per-net client
      lock is taken on clients list walk.
      Signed-off-by: NStanislav Kinsbursky <skinsbursky@parallels.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      da3b4622
  4. 27 2月, 2012 1 次提交
  5. 19 2月, 2012 2 次提交
  6. 18 2月, 2012 2 次提交
  7. 17 2月, 2012 4 次提交
  8. 16 2月, 2012 1 次提交
  9. 15 2月, 2012 9 次提交