1. 01 Mar, 2012 1 commit
  2. 26 Jan, 2012 1 commit
    • Andy Adamson's avatar
      NFSv4: include bitmap in nfsv4 get acl data · 628fc192
      Andy Adamson authored
      commit bf118a34 upstream.
      
      The NFSv4 bitmap size is unbounded: a server can return an arbitrary
      sized bitmap in an FATTR4_WORD0_ACL request.  Replace using the
      nfs4_fattr_bitmap_maxsz as a guess to the maximum bitmask returned by a server
      with the inclusion of the bitmap (xdr length plus bitmasks) and the acl data
      xdr length to the (cached) acl page data.
      
      This is a general solution to commit e5012d1f
      
       "NFSv4.1: update
      nfs4_fattr_bitmap_maxsz" and fixes hitting a BUG_ON in xdr_shrink_bufhead
      when getting ACLs.
      
      Fix a bug in decode_getacl that returned -EINVAL on ACLs > page when getxattr
      was called with a NULL buffer, preventing ACL > PAGE_SIZE from being retrieved.
      Signed-off-by: default avatarAndy Adamson <andros@netapp.com>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      628fc192
  3. 31 Oct, 2011 1 commit
  4. 31 Jul, 2011 4 commits
  5. 12 Jul, 2011 4 commits
  6. 11 Jul, 2011 1 commit
  7. 21 Jun, 2011 1 commit
  8. 16 Jun, 2011 1 commit
  9. 15 Jun, 2011 1 commit
  10. 29 May, 2011 3 commits
  11. 27 Apr, 2011 2 commits
    • Bryan Schumaker's avatar
      NFS: Return meaningful status from decode_secinfo() · 613e901e
      Bryan Schumaker authored
      
      When compiling, I was getting this warning:
      fs/nfs/nfs4xdr.c: In function ‘decode_secinfo’:
      fs/nfs/nfs4xdr.c:4839:6: warning: variable ‘status’ set but not used
      [-Wunused-but-set-variable]
      
      We were unconditionally returning 0 as long as there wasn't an error
      coming out of xdr_inline_decode().  We probably want to check the error
      status coming out of decode_op_hdr() and decode_secinfo_gss(), rather
      than assuming that everything is OK all the time.
      Signed-off-by: default avatarBryan Schumaker <bjschuma@netapp.com>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      613e901e
    • Trond Myklebust's avatar
      NFSv4: Ensure we request the ordinary fileid when doing readdirplus · 28331a46
      Trond Myklebust authored
      
      When readdir() returns a directory entry for the root of a mounted
      filesystem, Linux follows the old convention of returning the inode
      number of the covered directory (despite newer versions of POSIX declaring
      that this is a bug).
      To ensure this continues to work, the NFSv4 readdir implementation requests
      the 'mounted-on-fileid' from the server.
      
      However, readdirplus also needs to instantiate an inode for this entry, and
      for that, we also need to request the real fileid as per this patch.
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      28331a46
  12. 13 Apr, 2011 1 commit
    • Bryan Schumaker's avatar
      NFS: Use correct variable for page bounds checking · c3dfc280
      Bryan Schumaker authored
      
      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: default avatarBryan Schumaker <bjschuma@netapp.com>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      c3dfc280
  13. 24 Mar, 2011 3 commits
  14. 23 Mar, 2011 2 commits
  15. 11 Mar, 2011 4 commits
  16. 10 Mar, 2011 1 commit
  17. 28 Jan, 2011 2 commits
    • Chuck Lever's avatar
      NFS: NFSv4 readdir loses entries · d1205f87
      Chuck Lever authored
      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: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      d1205f87
    • Chuck Lever's avatar
      NFS: Micro-optimize nfs4_decode_dirent() · c08e76d0
      Chuck Lever authored
      
      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: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      c08e76d0
  18. 10 Jan, 2011 1 commit
    • Trond Myklebust's avatar
      NFS: Don't use vm_map_ram() in readdir · 6650239a
      Trond Myklebust authored
      
      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: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      Tested-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      Cc: stable@kernel.org  [2.6.37]
      6650239a
  19. 06 Jan, 2011 3 commits
    • Trond Myklebust's avatar
      NFSv4: Ensure continued open and lockowner name uniqueness · d035c36c
      Trond Myklebust authored
      
      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: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      d035c36c
    • Fred Isaman's avatar
      pnfs: serialize LAYOUTGET(openstateid) · cf7d63f1
      Fred Isaman authored
      
      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: default avatarFred Isaman <iisaman@netapp.com>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      cf7d63f1
    • Fred Isaman's avatar
      pnfs: change layout state seqlock to a spinlock · fd6002e9
      Fred Isaman authored
      
      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: default avatarFred Isaman <iisaman@netapp.com>
      Signed-off-by: default avatarBenny Halevy <bhalevy@panasas.com>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      fd6002e9
  20. 16 Dec, 2010 3 commits