1. 28 Feb, 2013 1 commit
  2. 17 Feb, 2013 3 commits
    • Jeff Layton's avatar
      nfsd: fix compiler warning about ambiguous types in nfsd_cache_csum · 56edc86b
      Jeff Layton authored
      kbuild test robot says:
      
      tree:   git://linux-nfs.org/~bfields/linux.git for-3.9
      head:   deb4534f
      commit: 01a7decf [32/44] nfsd: keep a checksum of the first 256 bytes of request
      config: i386-randconfig-x088 (attached as .config)
      
      All warnings:
      
         fs/nfsd/nfscache.c: In function 'nfsd_cache_csum':
      >> fs/nfsd/nfscache.c:266:9: warning: comparison of distinct pointer types lacks a cast [enabled by default]
      
      vim +266 fs/nfsd/nfscache.c
      
         250		__wsum csum;
         251		struct xdr_buf *buf = &rqstp->rq_arg;
         252		const unsigned char *p = buf->head[0].iov_base;
         253		size_t csum_len = min_t(size_t, buf->head[0].iov_len + buf->page_len,
         254					RC_CSUMLEN);
         255		size_t len = min(buf->head[0].iov_len, csum_len);
         256
         257		/* rq_arg.head first */
         258		csum = csum_partial(p, len, 0);
         259		csum_len -= len;
         260
         261		/* Continue into page array */
         262		idx = buf->page_base / PAGE_SIZE;
         263		base = buf->page_base & ~PAGE_MASK;
         264		while (csum_len) {
         265			p = page_address(buf->pages[idx]) + base;
       > 266			len = min(PAGE_SIZE - base, csum_len);
         267			csum = csum_partial(p, len, csum);
         268			csum_len -= len;
         269			base = 0;
         270			++idx;
         271		}
         272		return csum;
         273	}
         274
      Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
      Reported-by: default avatarkbuild test robot <fengguang.wu@intel.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      56edc86b
    • J. Bruce Fields's avatar
      svcrpc: fix rpc server shutdown races · cc630d9f
      J. Bruce Fields authored
      Rewrite server shutdown to remove the assumption that there are no
      longer any threads running (no longer true, for example, when shutting
      down the service in one network namespace while it's still running in
      others).
      
      Do that by doing what we'd do in normal circumstances: just CLOSE each
      socket, then enqueue it.
      
      Since there may not be threads to handle the resulting queued xprts,
      also run a simplified version of the svc_recv() loop run by a server to
      clean up any closed xprts afterwards.
      
      Cc: stable@kernel.org
      Tested-by: default avatarJason Tibbitts <tibbs@math.uh.edu>
      Tested-by: default avatarPaweł Sikora <pawel.sikora@agmk.net>
      Acked-by: default avatarStanislav Kinsbursky <skinsbursky@parallels.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      cc630d9f
    • J. Bruce Fields's avatar
      svcrpc: make svc_age_temp_xprts enqueue under sv_lock · e75bafbf
      J. Bruce Fields authored
      svc_age_temp_xprts expires xprts in a two-step process: first it takes
      the sv_lock and moves the xprts to expire off their server-wide list
      (sv_tempsocks or sv_permsocks) to a local list.  Then it drops the
      sv_lock and enqueues and puts each one.
      
      I see no reason for this: svc_xprt_enqueue() will take sp_lock, but the
      sv_lock and sp_lock are not otherwise nested anywhere (and documentation
      at the top of this file claims it's correct to nest these with sp_lock
      inside.)
      
      Cc: stable@kernel.org
      Tested-by: default avatarJason Tibbitts <tibbs@math.uh.edu>
      Tested-by: default avatarPaweł Sikora <pawel.sikora@agmk.net>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      e75bafbf
  3. 15 Feb, 2013 12 commits
  4. 11 Feb, 2013 1 commit
  5. 08 Feb, 2013 2 commits
    • Jeff Layton's avatar
      nfsd: keep a checksum of the first 256 bytes of request · 01a7decf
      Jeff Layton authored
      Now that we're allowing more DRC entries, it becomes a lot easier to hit
      problems with XID collisions. In order to mitigate those, calculate a
      checksum of up to the first 256 bytes of each request coming in and store
      that in the cache entry, along with the total length of the request.
      
      This initially used crc32, but Chuck Lever and Jim Rees pointed out that
      crc32 is probably more heavyweight than we really need for generating
      these checksums, and recommended looking at using the same routines that
      are used to generate checksums for IP packets.
      
      On an x86_64 KVM guest measurements with ftrace showed ~800ns to use
      csum_partial vs ~1750ns for crc32.  The difference probably isn't
      terribly significant, but for now we may as well use csum_partial.
      Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
      Stones-thrown-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
      01a7decf
    • Jeff Layton's avatar
      sunrpc: trim off trailing checksum before returning decrypted or integrity authenticated buffer · 4c190e2f
      Jeff Layton authored
      When GSSAPI integrity signatures are in use, or when we're using GSSAPI
      privacy with the v2 token format, there is a trailing checksum on the
      xdr_buf that is returned.
      
      It's checked during the authentication stage, and afterward nothing
      cares about it. Ordinarily, it's not a problem since the XDR code
      generally ignores it, but it will be when we try to compute a checksum
      over the buffer to help prevent XID collisions in the duplicate reply
      cache.
      
      Fix the code to trim off the checksums after verifying them. Note that
      in unwrap_integ_data, we must avoid trying to reverify the checksum if
      the request was deferred since it will no longer be present when it's
      revisited.
      Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
      4c190e2f
  6. 05 Feb, 2013 5 commits
  7. 04 Feb, 2013 16 commits