1. 06 8月, 2016 2 次提交
  2. 20 7月, 2016 1 次提交
    • S
      sunrpc: move NO_CRKEY_TIMEOUT to the auth->au_flags · ce52914e
      Scott Mayhew 提交于
      A generic_cred can be used to look up a unx_cred or a gss_cred, so it's
      not really safe to use the the generic_cred->acred->ac_flags to store
      the NO_CRKEY_TIMEOUT flag.  A lookup for a unx_cred triggered while the
      KEY_EXPIRE_SOON flag is already set will cause both NO_CRKEY_TIMEOUT and
      KEY_EXPIRE_SOON to be set in the ac_flags, leaving the user associated
      with the auth_cred to be in a state where they're perpetually doing 4K
      NFS_FILE_SYNC writes.
      
      This can be reproduced as follows:
      
      1. Mount two NFS filesystems, one with sec=krb5 and one with sec=sys.
      They do not need to be the same export, nor do they even need to be from
      the same NFS server.  Also, v3 is fine.
      $ sudo mount -o v3,sec=krb5 server1:/export /mnt/krb5
      $ sudo mount -o v3,sec=sys server2:/export /mnt/sys
      
      2. As the normal user, before accessing the kerberized mount, kinit with
      a short lifetime (but not so short that renewing the ticket would leave
      you within the 4-minute window again by the time the original ticket
      expires), e.g.
      $ kinit -l 10m -r 60m
      
      3. Do some I/O to the kerberized mount and verify that the writes are
      wsize, UNSTABLE:
      $ dd if=/dev/zero of=/mnt/krb5/file bs=1M count=1
      
      4. Wait until you're within 4 minutes of key expiry, then do some more
      I/O to the kerberized mount to ensure that RPC_CRED_KEY_EXPIRE_SOON gets
      set.  Verify that the writes are 4K, FILE_SYNC:
      $ dd if=/dev/zero of=/mnt/krb5/file bs=1M count=1
      
      5. Now do some I/O to the sec=sys mount.  This will cause
      RPC_CRED_NO_CRKEY_TIMEOUT to be set:
      $ dd if=/dev/zero of=/mnt/sys/file bs=1M count=1
      
      6. Writes for that user will now be permanently 4K, FILE_SYNC for that
      user, regardless of which mount is being written to, until you reboot
      the client.  Renewing the kerberos ticket (assuming it hasn't already
      expired) will have no effect.  Grabbing a new kerberos ticket at this
      point will have no effect either.
      
      Move the flag to the auth->au_flags field (which is currently unused)
      and rename it slightly to reflect that it's no longer associated with
      the auth_cred->ac_flags.  Add the rpc_auth to the arg list of
      rpcauth_cred_key_to_expire and check the au_flags there too.  Finally,
      add the inode to the arg list of nfs_ctx_key_to_expire so we can
      determine the rpc_auth to pass to rpcauth_cred_key_to_expire.
      Signed-off-by: NScott Mayhew <smayhew@redhat.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      ce52914e
  3. 12 7月, 2016 1 次提交
    • C
      xprtrdma: No direct data placement with krb5i and krb5p · 65b80179
      Chuck Lever 提交于
      Direct data placement is not allowed when using flavors that
      guarantee integrity or privacy. When such security flavors are in
      effect, don't allow the use of Read and Write chunks for moving
      individual data items. All messages larger than the inline threshold
      are sent via Long Call or Long Reply.
      
      On my systems (CX-3 Pro on FDR), for small I/O operations, the use
      of Long messages adds only around 5 usecs of latency in each
      direction.
      
      Note that when integrity or encryption is used, the host CPU touches
      every byte in these messages. Even if it could be used, data
      movement offload doesn't buy much in this case.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Tested-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      65b80179
  4. 15 6月, 2016 2 次提交
  5. 14 6月, 2016 3 次提交
  6. 29 5月, 2016 1 次提交
    • G
      <linux/sunrpc/svcauth.h>: Define hash_str() in terms of hashlen_string() · 917ea166
      George Spelvin 提交于
      Finally, the first use of previous two patches: eliminate the
      separate ad-hoc string hash functions in the sunrpc code.
      
      Now hash_str() is a wrapper around hash_string(), and hash_mem() is
      likewise a wrapper around full_name_hash().
      
      Note that sunrpc code *does* call hash_mem() with a zero length, which
      is why the previous patch needed to handle that in full_name_hash().
      (Thanks, Bruce, for finding that!)
      
      This also eliminates the only caller of hash_long which asks for
      more than 32 bits of output.
      
      The comment about the quality of hashlen_string() and full_name_hash()
      is jumping the gun by a few patches; they aren't very impressive now,
      but will be improved greatly later in the series.
      Signed-off-by: NGeorge Spelvin <linux@sciencehorizons.net>
      Tested-by: NJ. Bruce Fields <bfields@redhat.com>
      Acked-by: NJ. Bruce Fields <bfields@redhat.com>
      Cc: Jeff Layton <jlayton@poochiereds.net>
      Cc: linux-nfs@vger.kernel.org
      917ea166
  7. 18 5月, 2016 4 次提交
  8. 14 5月, 2016 1 次提交
  9. 09 5月, 2016 3 次提交
  10. 05 4月, 2016 1 次提交
  11. 15 3月, 2016 3 次提交
  12. 02 3月, 2016 8 次提交
  13. 06 2月, 2016 6 次提交
  14. 01 2月, 2016 4 次提交
    • T
      SUNRPC: Make freeing of struct xprt rcu-safe · fda1bfef
      Trond Myklebust 提交于
      Have it call kfree_rcu() to ensure that we can use it on rcu-protected
      lists.
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      fda1bfef
    • T
      SUNRPC: Uninline xprt_get(); It isn't performance critical. · 30c5116b
      Trond Myklebust 提交于
      Also allow callers to pass NULL arguments to xprt_get() and xprt_put().
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      30c5116b
    • T
      SUNRPC: Reorder rpc_task to put waitqueue related info in same cachelines · 5edd1051
      Trond Myklebust 提交于
      Try to group all the data required by the waitqueues, their timers and timer
      callbacks into the same cachelines for performance. With this reordering,
      "pahole" reports the following structure on x86_64:
      
      struct rpc_task {
              atomic_t                   tk_count;             /*     0     4 */
              int                        tk_status;            /*     4     4 */
              struct list_head           tk_task;              /*     8    16 */
              void                       (*tk_callback)(struct rpc_task *); /*    24
              void                       (*tk_action)(struct rpc_task *); /*    32
              long unsigned int          tk_timeout;           /*    40     8 */
              long unsigned int          tk_runstate;          /*    48     8 */
              struct rpc_wait_queue *    tk_waitqueue;         /*    56     8 */
              /* --- cacheline 1 boundary (64 bytes) --- */
              union {
                      struct work_struct tk_work;              /*          64 */
                      struct rpc_wait    tk_wait;              /*          56 */
              } u;                                             /*    64    64 */
              /* --- cacheline 2 boundary (128 bytes) --- */
              struct rpc_message         tk_msg;               /*   128    32 */
              void *                     tk_calldata;          /*   160     8 */
              const struct rpc_call_ops  * tk_ops;             /*   168     8 */
              struct rpc_clnt *          tk_client;            /*   176     8 */
              struct rpc_rqst *          tk_rqstp;             /*   184     8 */
              /* --- cacheline 3 boundary (192 bytes) --- */
              struct workqueue_struct *  tk_workqueue;         /*   192     8 */
              ktime_t                    tk_start;             /*   200     8 */
              pid_t                      tk_owner;             /*   208     4 */
              short unsigned int         tk_flags;             /*   212     2 */
              short unsigned int         tk_timeouts;          /*   214     2 */
              short unsigned int         tk_pid;               /*   216     2 */
              unsigned char              tk_priority:2;        /*   218: 6  1 */
              unsigned char              tk_garb_retry:2;      /*   218: 4  1 */
              unsigned char              tk_cred_retry:2;      /*   218: 2  1 */
              unsigned char              tk_rebind_retry:2;    /*   218: 0  1 */
      
              /* size: 224, cachelines: 4, members: 24 */
              /* padding: 5 */
              /* last cacheline: 32 bytes */
      };
      
      whereas on i386, it reports everything fitting into the 1st cacheline.
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      5edd1051
    • T