1. 14 4月, 2011 1 次提交
    • B
      NFS: Use correct variable for page bounds checking · c3dfc280
      Bryan Schumaker 提交于
      While decoding a secinfo reply, I store the list of supported sec
      flavors on a page accessible through res->flavors.  Before reading
      each new flavor, I do some math to determine if there is enough
      space left on this page, and I break out of my read look if there
      isn't.  In order to perform this check correctly, I need to use the
      address of res->flavors, rather than the address of res.
      
      When this loop was broken early I lied to the caller and told them
      that the entire list had been decoded.  This could lead to problems
      if the caller tries to use any the garbage data claiming to be a
      valid sec flavor.  I fixed this by using res->flavors->num_flavors
      as a counter, incrementing it every time a sec flavor is
      successfully decoded.
      Signed-off-by: NBryan Schumaker <bjschuma@netapp.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      c3dfc280
  2. 25 3月, 2011 3 次提交
  3. 24 3月, 2011 2 次提交
  4. 12 3月, 2011 4 次提交
  5. 11 3月, 2011 1 次提交
  6. 29 1月, 2011 2 次提交
    • C
      NFS: NFSv4 readdir loses entries · d1205f87
      Chuck Lever 提交于
      On recent 2.6.38-rc kernels, connectathon basic test 6 fails on
      NFSv4 mounts of OpenSolaris with something like:
      
      > ./test6: readdir
      > 	./test6: (/mnt/klimt/matisse.test) didn't read expected 'file.12' dir entry, pass 0
      > 	./test6: (/mnt/klimt/matisse.test) didn't read expected 'file.82' dir entry, pass 0
      > 	./test6: (/mnt/klimt/matisse.test) didn't read expected 'file.164' dir entry, pass 0
      > 	./test6: (/mnt/klimt/matisse.test) Test failed with 3 errors
      > basic tests failed
      > Tests failed, leaving /mnt/klimt mounted
      > [cel@matisse cthon04]$
      
      I narrowed the problem down to nfs4_decode_dirent() reporting that the
      decode buffer had overflowed while decoding the entries for those
      missing files.
      
      verify_attr_len() assumes both it's pointer arguments reside on the
      same page.  When these arguments point to locations on two different
      pages, verify_attr_len() can report false errors.  This can happen now
      that a large NFSv4 readdir result can span pages.
      
      We have reasonably good checking in nfs4_decode_dirent() anyway, so
      it should be safe to simply remove the extra checking.
      
      At a guess, this was introduced by commit 6650239a, "NFS: Don't use
      vm_map_ram() in readdir".
      
      Cc: stable@kernel.org [2.6.37]
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      d1205f87
    • C
      NFS: Micro-optimize nfs4_decode_dirent() · c08e76d0
      Chuck Lever 提交于
      Make the decoding of NFSv4 directory entries slightly more efficient
      by:
      
        1.  Avoiding unnecessary byte swapping when checking XDR booleans,
            and
      
        2.  Not bumping "p" when its value will be immediately replaced by
            xdr_inline_decode()
      
      This commit makes nfs4_decode_dirent() consistent with similar logic
      in the other two decode_dirent() functions.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      c08e76d0
  7. 11 1月, 2011 1 次提交
    • T
      NFS: Don't use vm_map_ram() in readdir · 6650239a
      Trond Myklebust 提交于
      vm_map_ram() is not available on NOMMU platforms, and causes trouble
      on incoherrent architectures such as ARM when we access the page data
      through both the direct and the virtual mapping.
      
      The alternative is to use the direct mapping to access page data
      for the case when we are not crossing a page boundary, but to copy
      the data into a linear scratch buffer when we are accessing data
      that spans page boundaries.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      Tested-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      Cc: stable@kernel.org  [2.6.37]
      6650239a
  8. 07 1月, 2011 3 次提交
    • T
      NFSv4: Ensure continued open and lockowner name uniqueness · d035c36c
      Trond Myklebust 提交于
      In order to enable migration support, we will want to move some of the
      structures that are subject to migration into the struct nfs_server.
      In particular, if we are to move the state_owner and state_owner_id to
      being a per-filesystem structure, then we should label the resulting
      open/lock owners with a per-filesytem label to ensure global uniqueness.
      
      This patch does so by adding the super block s_dev to the open/lock owner
      name.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      d035c36c
    • F
      pnfs: serialize LAYOUTGET(openstateid) · cf7d63f1
      Fred Isaman 提交于
      We shouldn't send a LAYOUTGET(openstateid) unless all outstanding RPCs
      using the previous stateid are completed.  This requires choosing the
      stateid to encode earlier, so we can abort if one is not available (we
      want to use the open stateid, but a LAYOUTGET is already out using
      it), and adding a count of the number of outstanding rpc calls using
      layout state (which for now consist solely of LAYOUTGETs).
      Signed-off-by: NFred Isaman <iisaman@netapp.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      cf7d63f1
    • F
      pnfs: change layout state seqlock to a spinlock · fd6002e9
      Fred Isaman 提交于
      This prepares for future changes, where the layout state needs
      to change atomically with several other variables.  In particular,
      it will need to know if lo->segs is empty, as we test that instead
      of manipulating the NFS_LAYOUT_STATEID_SET bit.  Moreover, the
      layoutstateid is not really a read-mostly structure, as it is
      written almost as often as it is read.
      
      The behavior of pnfs_get_layout_stateid is also slightly changed, so that
      it no longer changes the stateid.  Its name is changed to +pnfs_choose_layoutget_stateid.
      Signed-off-by: NFred Isaman <iisaman@netapp.com>
      Signed-off-by: NBenny Halevy <bhalevy@panasas.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      fd6002e9
  9. 17 12月, 2010 6 次提交
  10. 23 11月, 2010 2 次提交
  11. 16 11月, 2010 1 次提交
  12. 25 10月, 2010 7 次提交
  13. 24 10月, 2010 6 次提交
  14. 08 10月, 2010 1 次提交
    • B
      NFS: new idmapper · 955a857e
      Bryan Schumaker 提交于
      This patch creates a new idmapper system that uses the request-key function to
      place a call into userspace to map user and group ids to names.  The old
      idmapper was single threaded, which prevented more than one request from running
      at a single time.  This means that a user would have to wait for an upcall to
      finish before accessing a cached result.
      
      The upcall result is stored on a keyring of type id_resolver.  See the file
      Documentation/filesystems/nfs/idmapper.txt for instructions.
      Signed-off-by: NBryan Schumaker <bjschuma@netapp.com>
      [Trond: fix up the return value of nfs_idmap_lookup_name and clean up code]
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      955a857e