1. 25 11月, 2015 2 次提交
    • J
      nfsd4: fix gss-proxy 4.1 mounts for some AD principals · 414ca017
      J. Bruce Fields 提交于
      The principal name on a gss cred is used to setup the NFSv4.0 callback,
      which has to have a client principal name to authenticate to.
      
      That code wants the name to be in the form servicetype@hostname.
      rpc.svcgssd passes down such names (and passes down no principal name at
      all in the case the principal isn't a service principal).
      
      gss-proxy always passes down the principal name, and passes it down in
      the form servicetype/hostname@REALM.  So we've been munging the name
      gss-proxy passes down into the format the NFSv4.0 callback code expects,
      or throwing away the name if we can't.
      
      Since the introduction of the MACH_CRED enforcement in NFSv4.1, we've
      also been using the principal name to verify that certain operations are
      done as the same principal as was used on the original EXCHANGE_ID call.
      
      For that application, the original name passed down by gss-proxy is also
      useful.
      
      Lack of that name in some cases was causing some kerberized NFSv4.1
      mount failures in an Active Directory environment.
      
      This fix only works in the gss-proxy case.  The fix for legacy
      rpc.svcgssd would be more involved, and rpc.svcgssd already has other
      problems in the AD case.
      Reported-and-tested-by: NJames Ralston <ralston@pobox.com>
      Acked-by: NSimo Sorce <simo@redhat.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      414ca017
    • J
      svcrpc: move some initialization to common code · 6496500c
      J. Bruce Fields 提交于
      Minor cleanup, no change in behavior.
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      6496500c
  2. 24 11月, 2015 1 次提交
    • C
      svcrdma: Do not send XDR roundup bytes for a write chunk · 6f18dc89
      Chuck Lever 提交于
      Minor optimization: when dealing with write chunk XDR roundup, do
      not post a Write WR for the zero bytes in the pad. Simply update
      the write segment in the RPC-over-RDMA header to reflect the extra
      pad bytes.
      
      The Reply chunk is also a write chunk, but the server does not use
      send_write_chunks() to send the Reply chunk. That's OK in this case:
      the server Upper Layer typically marshals the Reply chunk contents
      in a single contiguous buffer, without a separate tail for the XDR
      pad.
      
      The comments and the variable naming refer to "chunks" but what is
      really meant is "segments." The existing code sends only one
      xdr_write_chunk per RPC reply.
      
      The fix assumes this as well. When the XDR pad in the first write
      chunk is reached, the assumption is the Write list is complete and
      send_write_chunks() returns.
      
      That will remain a valid assumption until the server Upper Layer can
      support multiple bulk payload results per RPC.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      6f18dc89
  3. 11 11月, 2015 1 次提交
  4. 10 11月, 2015 1 次提交
  5. 04 11月, 2015 2 次提交
  6. 03 11月, 2015 17 次提交
  7. 29 10月, 2015 3 次提交
  8. 24 10月, 2015 3 次提交
    • N
      sunrpc/cache: make cache flushing more reliable. · 77862036
      Neil Brown 提交于
      The caches used to store sunrpc authentication information can be
      flushed by writing a timestamp to a file in /proc.
      
      This timestamp has a one-second resolution and any entry in cache that
      was last_refreshed *before* that time is treated as expired.
      
      This is problematic as it is not possible to reliably flush the cache
      without interrupting NFS service.
      If the current time is written to the "flush" file, any entry that was
      added since the current second started will still be treated as valid.
      If one second beyond than the current time is written to the file
      then no entries can be valid until the second ticks over.  This will
      mean that no NFS request will be handled for up to 1 second.
      
      To resolve this issue we make two changes:
      
      1/ treat an entry as expired if the timestamp when it was last_refreshed
        is before *or the same as* the expiry time.  This means that current
        code which writes out the current time will now flush the cache
        reliably.
      
      2/ when a new entry in added to the cache -  set the last_refresh timestamp
        to 1 second *beyond* the current flush time, when that not in the
        past.
        This ensures that newly added entries will always be valid.
      
      Now that we have a very reliable way to flush the cache, and also
      since we are using "since-boot" timestamps which are monotonic,
      change cache_purge() to set the smallest future flush_time which
      will work, and leave it there: don't revert to '1'.
      
      Also disable the setting of the 'flush_time' far into the future.
      That has never been useful and is now awkward as it would cause
      last_refresh times to be strange.
      Finally: if a request is made to set the 'flush_time' to the current
      second, assume the intent is to flush the cache and advance it, if
      necessary, to 1 second beyond the current 'flush_time' so that all
      active entries will be deemed to be expired.
      
      As part of this we need to add a 'cache_detail' arg to cache_init()
      and cache_fresh_locked() so they can find the current ->flush_time.
      Signed-off-by: NNeilBrown <neilb@suse.com>
      Reported-by: NOlaf Kirch <okir@suse.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      77862036
    • A
      sunrpc: avoid warning in gss_key_timeout · cc6a7aab
      Arnd Bergmann 提交于
      The gss_key_timeout() function causes a harmless warning in some
      configurations, e.g. ARM imx_v6_v7_defconfig with gcc-5.2, if the
      compiler cannot figure out the state of the 'expire' variable across
      an rcu_read_unlock():
      
      net/sunrpc/auth_gss/auth_gss.c: In function 'gss_key_timeout':
      net/sunrpc/auth_gss/auth_gss.c:1422:211: warning: 'expire' may be used uninitialized in this function [-Wmaybe-uninitialized]
      
      To avoid this warning without adding a bogus initialization, this
      rewrites the function so the comparison is done inside of the
      critical section. As a side-effect, it also becomes slightly
      easier to understand because the implementation now more closely
      resembles the comment above it.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: c5e6aecd ("sunrpc: fix RCU handling of gc_ctx field")
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      cc6a7aab
    • T
      SUNRPC: Use MSG_SENDPAGE_NOTLAST when calling sendpage() · 226453d8
      Trond Myklebust 提交于
      If we're sending more pages via kernel_sendpage(), then set
      MSG_SENDPAGE_NOTLAST.
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      226453d8
  9. 12 10月, 2015 1 次提交
  10. 08 10月, 2015 6 次提交
  11. 07 10月, 2015 1 次提交
  12. 30 9月, 2015 1 次提交
    • S
      svcrdma: handle rdma read with a non-zero initial page offset · c91aed98
      Steve Wise 提交于
      The server rdma_read_chunk_lcl() and rdma_read_chunk_frmr() functions
      were not taking into account the initial page_offset when determining
      the rdma read length.  This resulted in a read who's starting address
      and length exceeded the base/bounds of the frmr.
      
      The server gets an async error from the rdma device and kills the
      connection, and the client then reconnects and resends.  This repeats
      indefinitely, and the application hangs.
      
      Most work loads don't tickle this bug apparently, but one test hit it
      every time: building the linux kernel on a 16 core node with 'make -j
      16 O=/mnt/0' where /mnt/0 is a ramdisk mounted via NFSRDMA.
      
      This bug seems to only be tripped with devices having small fastreg page
      list depths.  I didn't see it with mlx4, for instance.
      
      Fixes: 0bf48289 ('svcrdma: refactor marshalling logic')
      Signed-off-by: NSteve Wise <swise@opengridcomputing.com>
      Tested-by: NChuck Lever <chuck.lever@oracle.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      c91aed98
  13. 28 9月, 2015 1 次提交