1. 03 8月, 2012 2 次提交
  2. 31 7月, 2012 4 次提交
  3. 18 7月, 2012 1 次提交
  4. 17 7月, 2012 10 次提交
    • C
      NFS: Clean up nfs4_proc_setclientid() and friends · 6bbb4ae8
      Chuck Lever 提交于
      Add documenting comments and appropriate debugging messages.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      6bbb4ae8
    • C
      NFS: Treat NFS4ERR_CLID_INUSE as a fatal error · de734831
      Chuck Lever 提交于
      For NFSv4 minor version 0, currently the cl_id_uniquifier allows the
      Linux client to generate a unique nfs_client_id4 string whenever a
      server replies with NFS4ERR_CLID_INUSE.
      
      This implementation seems to be based on a flawed reading of RFC
      3530.  NFS4ERR_CLID_INUSE actually means that the client has presented
      this nfs_client_id4 string with a different principal at some time in
      the past, and that lease is still in use on the server.
      
      For a Linux client this might be rather difficult to achieve: the
      authentication flavor is named right in the nfs_client_id4.id
      string.  If we change flavors, we change strings automatically.
      
      So, practically speaking, NFS4ERR_CLID_INUSE means there is some other
      client using our string.  There is not much that can be done to
      recover automatically.  Let's make it a permanent error.
      
      Remove the recovery logic in nfs4_proc_setclientid(), and remove the
      cl_id_uniquifier field from the nfs_client data structure.  And,
      remove the authentication flavor from the nfs_client_id4 string.
      
      Keeping the authentication flavor in the nfs_client_id4.id string
      means that we could have a separate lease for each authentication
      flavor used by mounts on the client.  But we want just one lease for
      all the mounts on this client.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      de734831
    • C
      NFS: When state recovery fails, waiting tasks should exit · 46a87b8a
      Chuck Lever 提交于
      NFSv4 state recovery is not always successful.  Failure is signalled
      by setting the nfs_client.cl_cons_state to a negative (errno) value,
      then waking waiters.
      
      Currently this can happen only during mount processing.  I'm about to
      add an explicit case where state recovery failure during normal
      operation should force all NFS requests waiting on that state recovery
      to exit.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      46a87b8a
    • C
      SUNRPC: Add rpcauth_list_flavors() · 6a1a1e34
      Chuck Lever 提交于
      The gss_mech_list_pseudoflavors() function provides a list of
      currently registered GSS pseudoflavors.  This list does not include
      any non-GSS flavors that have been registered with the RPC client.
      nfs4_find_root_sec() currently adds these extra flavors by hand.
      
      Instead, nfs4_find_root_sec() should be looking at the set of flavors
      that have been explicitly registered via rpcauth_register().  And,
      other areas of code will soon need the same kind of list that
      contains all flavors the kernel currently knows about (see below).
      
      Rather than cloning the open-coded logic in nfs4_find_root_sec() to
      those new places, introduce a generic RPC function that generates a
      full list of registered auth flavors and pseudoflavors.
      
      A new rpc_authops method is added that lists a flavor's
      pseudoflavors, if it has any.  I encountered an interesting module
      loader loop when I tried to get the RPC client to invoke
      gss_mech_list_pseudoflavors() by name.
      
      This patch is a pre-requisite for server trunking discovery, and a
      pre-requisite for fixing up the in-kernel mount client to do better
      automatic security flavor selection.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      6a1a1e34
    • C
      NFS: nfs_getaclargs.acl_len is a size_t · 56d08fef
      Chuck Lever 提交于
      Squelch compiler warnings:
      
      fs/nfs/nfs4proc.c: In function ‘__nfs4_get_acl_uncached’:
      fs/nfs/nfs4proc.c:3811:14: warning: comparison between signed and
      	unsigned integer expressions [-Wsign-compare]
      fs/nfs/nfs4proc.c:3818:15: warning: comparison between signed and
      	unsigned integer expressions [-Wsign-compare]
      
      Introduced by commit bf118a34 "NFSv4: include bitmap in nfsv4 get
      acl data", Dec 7, 2011.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      56d08fef
    • C
      NFS: Clean up TEST_STATEID and FREE_STATEID error reporting · 38527b15
      Chuck Lever 提交于
      As a finishing touch, add appropriate documenting comments and some
      debugging printk's.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      38527b15
    • C
      NFS: Clean up nfs41_check_expired_stateid() · 3e60ffdd
      Chuck Lever 提交于
      Clean up: Instead of open-coded flag manipulation, use test_bit() and
      clear_bit() just like all other accessors of the state->flag field.
      This also eliminates several unnecessary implicit integer type
      conversions.
      
      To make it absolutely clear what is going on, a number of comments
      are introduced.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      3e60ffdd
    • C
      NFS: State reclaim clears OPEN and LOCK state · eb64cf96
      Chuck Lever 提交于
      The "state->flags & flags" test in nfs41_check_expired_stateid()
      allows the state manager to squelch a TEST_STATEID operation when
      it is known for sure that a state ID is no longer valid.  If the
      lease was purged, for example, the client already knows that state
      ID is now defunct.
      
      But open recovery is still needed for that inode.
      
      To force a call to nfs4_open_expired(), change the default return
      value for nfs41_check_expired_stateid() to force open recovery, and
      the default return value for nfs41_check_locks() to force lock
      recovery, if the requested flags are clear.  Fix suggested by Bryan
      Schumaker.
      
      Also, the presence of a delegation state ID must not prevent normal
      open recovery.  The delegation state ID must be cleared if it was
      revoked, but once cleared I don't think it's presence or absence has
      any bearing on whether open recovery is still needed.  So the logic
      is adjusted to ignore the TEST_STATEID result for the delegation
      state ID.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      eb64cf96
    • C
      NFS: Don't free a state ID the server does not recognize · 89af2739
      Chuck Lever 提交于
      The result of a TEST_STATEID operation can indicate a few different
      things:
      
        o If NFS_OK is returned, then the client can continue using the
          state ID under test, and skip recovery.
      
        o RFC 5661 says that if the state ID was revoked, then the client
          must perform an explicit FREE_STATEID before trying to re-open.
      
        o If the server doesn't recognize the state ID at all, then no
          FREE_STATEID is needed, and the client can immediately continue
          with open recovery.
      
      Let's err on the side of caution: if the server clearly tells us the
      state ID is unknown, we skip the FREE_STATEID.  For any other error,
      we issue a FREE_STATEID.  Sometimes that FREE_STATEID will be
      unnecessary, but leaving unused state IDs on the server needlessly
      ties up resources.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      89af2739
    • C
      NFS: Fix up TEST_STATEID and FREE_STATEID return code handling · 377e507d
      Chuck Lever 提交于
      The TEST_STATEID and FREE_STATEID operations can return
      -NFS4ERR_BAD_STATEID, -NFS4ERR_OLD_STATEID, or -NFS4ERR_DEADSESSION.
      
      nfs41_{test,free}_stateid() should not pass these errors to
      nfs4_handle_exception() during state recovery, since that will
      recursively kick off state recovery again, resulting in a deadlock.
      
      In particular, when the TEST_STATEID operation returns NFS4_OK,
      res.status can contain one of these errors.  _nfs41_test_stateid()
      replaces NFS4_OK with the value in res.status, which is then returned
      to callers.
      
      But res.status is not passed through nfs4_stat_to_errno(), and thus is
      a positive NFS4ERR value.  Currently callers are only interested in
      !NFS4_OK, and nfs4_handle_exception() ignores positive values.
      
      Thus the res.status values are currently ignored by
      nfs4_handle_exception() and won't cause the deadlock above.  Thanks to
      this missing negative, it is only when these operations fail (which
      is very rare) that a deadlock can occur.
      
      Bryan agrees the original intent was to return res.status as a
      negative NFS4ERR value to callers of nfs41_test_stateid().
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      377e507d
  5. 14 7月, 2012 1 次提交
    • M
      nfs: clean up ->create in nfs_rpc_ops · 8867fe58
      Miklos Szeredi 提交于
      Don't pass nfs_open_context() to ->create().  Only the NFS4 implementation
      needed that and only because it wanted to return an open file using open
      intents.  That task has been replaced by ->atomic_open so it is not necessary
      anymore to pass the context to the create rpc operation.
      
      Despite nfs4_proc_create apparently being okay with a NULL context it Oopses
      somewhere down the call chain.  So allocate a context here.
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      CC: Trond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      8867fe58
  6. 29 6月, 2012 9 次提交
  7. 12 6月, 2012 1 次提交
  8. 08 6月, 2012 2 次提交
  9. 07 6月, 2012 1 次提交
  10. 05 6月, 2012 2 次提交
    • T
      NFSv4.1: Convert a trivial printk into a dprintk · 08106ac7
      Trond Myklebust 提交于
      There is no need to bug the user about the server returning an error
      on destroy_session. The error will be handled by the state manager,
      without any need for further input from anyone else.
      So convert that printk into a debugging dprintk.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      08106ac7
    • T
      NFSv4: Fix an Oops in the open recovery code · 1549210f
      Trond Myklebust 提交于
      The open recovery code does not need to request a new value for the
      mdsthreshold, and so does not allocate a struct nfs4_threshold.
      The problem is that encode_getfattr_open() will still request an
      mdsthreshold, and so we end up Oopsing in decode_attr_mdsthreshold.
      
      This patch fixes encode_getfattr_open so that it doesn't request an
      mdsthreshold when the caller isn't asking for one. It also fixes
      decode_attr_mdsthreshold so that it errors if the server returns
      an mdsthreshold that we didn't ask for (instead of Oopsing).
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      Cc: Andy Adamson <andros@netapp.com>
      1549210f
  11. 29 5月, 2012 1 次提交
  12. 28 5月, 2012 2 次提交
  13. 27 5月, 2012 2 次提交
  14. 26 5月, 2012 2 次提交