1. 07 2月, 2012 2 次提交
  2. 01 2月, 2012 2 次提交
  3. 08 1月, 2012 1 次提交
    • T
      NFSv4: Save the owner/group name string when doing open · 6926afd1
      Trond Myklebust 提交于
      ...so that we can do the uid/gid mapping outside the asynchronous RPC
      context.
      This fixes a bug in the current NFSv4 atomic open code where the client
      isn't able to determine what the true uid/gid fields of the file are,
      (because the asynchronous nature of the OPEN call denies it the ability
      to do an upcall) and so fills them with default values, marking the
      inode as needing revalidation.
      Unfortunately, in some cases, the VFS will do some additional sanity
      checks on the file, and may override the server's decision to allow
      the open because it sees the wrong owner/group fields.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      6926afd1
  4. 05 1月, 2012 1 次提交
    • A
      NFSv4: include bitmap in nfsv4 get acl data · bf118a34
      Andy Adamson 提交于
      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.
      
      Cc: stable@kernel.org
      Signed-off-by: NAndy Adamson <andros@netapp.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      bf118a34
  5. 31 10月, 2011 1 次提交
  6. 01 8月, 2011 4 次提交
  7. 13 7月, 2011 4 次提交
  8. 12 7月, 2011 1 次提交
  9. 21 6月, 2011 1 次提交
  10. 17 6月, 2011 1 次提交
  11. 15 6月, 2011 1 次提交
  12. 30 5月, 2011 3 次提交
  13. 28 4月, 2011 2 次提交
    • B
      NFS: Return meaningful status from decode_secinfo() · 613e901e
      Bryan Schumaker 提交于
      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: NBryan Schumaker <bjschuma@netapp.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      613e901e
    • T
      NFSv4: Ensure we request the ordinary fileid when doing readdirplus · 28331a46
      Trond Myklebust 提交于
      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: NTrond Myklebust <Trond.Myklebust@netapp.com>
      28331a46
  14. 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
  15. 25 3月, 2011 3 次提交
  16. 24 3月, 2011 2 次提交
  17. 12 3月, 2011 4 次提交
  18. 11 3月, 2011 1 次提交
  19. 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
  20. 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
  21. 07 1月, 2011 2 次提交
    • 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