1. 29 5月, 2014 1 次提交
    • J
      nfsd4: use xdr_reserve_space in attribute encoding · ddd1ea56
      J. Bruce Fields 提交于
      This is a cosmetic change for now; no change in behavior.
      
      Note we're just depending on xdr_reserve_space to do the bounds checking
      for us, we're not really depending on its adjustment of iovec or xdr_buf
      lengths yet, as those are fixed up by as necessary after the fact by
      read-link operations and by nfs4svc_encode_compoundres.  However we do
      have to update xdr->iov on read-like operations to prevent
      xdr_reserve_space from messing with the already-fixed-up length of the
      the head.
      
      When the attribute encoding fails partway through we have to undo the
      length adjustments made so far.  We do it manually for now, but later
      patches will add an xdr_truncate_encode() helper to handle cases like
      this.
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      ddd1ea56
  2. 27 5月, 2014 1 次提交
  3. 23 5月, 2014 8 次提交
  4. 07 5月, 2014 1 次提交
  5. 30 3月, 2014 1 次提交
    • K
      NFSD: Clear wcc data between compound ops · 2336745e
      Kinglong Mee 提交于
      Testing NFS4.0 by pynfs, I got some messeages as,
      "nfsd: inode locked twice during operation."
      
      When one compound RPC contains two or more ops that locks
      the filehandle,the second op will cause the message.
      
      As two SETATTR ops, after the first SETATTR, nfsd will not call
      fh_put() to release current filehandle, it means filehandle have
      unlocked with fh_post_saved = 1.
      The second SETATTR find fh_post_saved = 1, and printk the message.
      
      v2: introduce helper fh_clear_wcc().
      Signed-off-by: NKinglong Mee <kinglongmee@gmail.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      2336745e
  6. 29 3月, 2014 2 次提交
  7. 28 3月, 2014 1 次提交
  8. 28 1月, 2014 2 次提交
  9. 26 1月, 2014 1 次提交
  10. 08 1月, 2014 1 次提交
  11. 04 1月, 2014 1 次提交
  12. 03 1月, 2014 1 次提交
  13. 08 8月, 2013 1 次提交
  14. 13 7月, 2013 1 次提交
    • J
      nfsd4: fix minorversion support interface · 35f7a14f
      J. Bruce Fields 提交于
      You can turn on or off support for minorversions using e.g.
      
      	echo "-4.2" >/proc/fs/nfsd/versions
      
      However, the current implementation is a little wonky.  For example, the
      above will turn off 4.2 support, but it will also turn *on* 4.1 support.
      
      This didn't matter as long as we only had 2 minorversions, which was
      true till very recently.
      
      And do a little cleanup here.
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      35f7a14f
  15. 02 7月, 2013 1 次提交
  16. 15 5月, 2013 1 次提交
  17. 04 5月, 2013 1 次提交
  18. 01 5月, 2013 1 次提交
    • J
      nfsd4: don't remap EISDIR errors in rename · 2a6cf944
      J. Bruce Fields 提交于
      We're going out of our way here to remap an error to make rfc 3530
      happy--but the rfc itself (nor rfc 1813, which has similar language)
      gives no justification.  And disagrees with local filesystem behavior,
      with Linux and posix man pages, and knfsd's implemented behavior for v2
      and v3.
      
      And the documented behavior seems better, in that it gives a little more
      information--you could implement the 3530 behavior using the posix
      behavior, but not the other way around.
      
      Also, the Linux client makes no attempt to remap this error in the v4
      case, so it can end up just returning EEXIST to the application in a
      case where it should return EISDIR.
      
      So honestly I think the rfc's are just buggy here--or in any case it
      doesn't see worth the trouble to remap this error.
      Reported-by: NFrank S Filz <ffilz@us.ibm.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      2a6cf944
  19. 09 4月, 2013 2 次提交
  20. 08 4月, 2013 1 次提交
    • J
      nfsd4: cleanup handling of nfsv4.0 closed stateid's · 9411b1d4
      J. Bruce Fields 提交于
      Closed stateid's are kept around a little while to handle close replays
      in the 4.0 case.  So we stash them in the last-used stateid in the
      oo_last_closed_stateid field of the open owner.  We can free that in
      encode_seqid_op_tail once the seqid on the open owner is next
      incremented.  But we don't want to do that on the close itself; so we
      set NFS4_OO_PURGE_CLOSE flag set on the open owner, skip freeing it the
      first time through encode_seqid_op_tail, then when we see that flag set
      next time we free it.
      
      This is unnecessarily baroque.
      
      Instead, just move the logic that increments the seqid out of the xdr
      code and into the operation code itself.
      
      The justification given for the current placement is that we need to
      wait till the last minute to be sure we know whether the status is a
      sequence-id-mutating error or not, but examination of the code shows
      that can't actually happen.
      Reported-by: NYanchuan Nian <ycnian@gmail.com>
      Tested-by: NYanchuan Nian <ycnian@gmail.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      9411b1d4
  21. 04 4月, 2013 1 次提交
  22. 03 4月, 2013 2 次提交
  23. 24 1月, 2013 1 次提交
  24. 18 12月, 2012 2 次提交
  25. 11 12月, 2012 2 次提交
    • S
      nfsd: make NFSd service boot time per-net · b9c0ef85
      Stanislav Kinsbursky 提交于
      This is simple: an NFSd service can be started at different times in
      different network environments. So, its "boot time" has to be assigned
      per net.
      Signed-off-by: NStanislav Kinsbursky <skinsbursky@parallels.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      b9c0ef85
    • N
      nfsd: avoid permission checks on EXCLUSIVE_CREATE replay · 7007c90f
      Neil Brown 提交于
      With NFSv4, if we create a file then open it we explicit avoid checking
      the permissions on the file during the open because the fact that we
      created it ensures we should be allow to open it (the create and the
      open should appear to be a single operation).
      
      However if the reply to an EXCLUSIVE create gets lots and the client
      resends the create, the current code will perform the permission check -
      because it doesn't realise that it did the open already..
      
      This patch should fix this.
      
      Note that I haven't actually seen this cause a problem.  I was just
      looking at the code trying to figure out a different EXCLUSIVE open
      related issue, and this looked wrong.
      
      (Fix confirmed with pynfs 4.0 test OPEN4--bfields)
      
      Cc: stable@kernel.org
      Signed-off-by: NNeilBrown <neilb@suse.de>
      [bfields: use OWNER_OVERRIDE and update for 4.1]
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      7007c90f
  26. 26 11月, 2012 1 次提交
    • J
      nfsd4: delay filling in write iovec array till after xdr decoding · ffe1137b
      J. Bruce Fields 提交于
      Our server rejects compounds containing more than one write operation.
      It's unclear whether this is really permitted by the spec; with 4.0,
      it's possibly OK, with 4.1 (which has clearer limits on compound
      parameters), it's probably not OK.  No client that we're aware of has
      ever done this, but in theory it could be useful.
      
      The source of the limitation: we need an array of iovecs to pass to the
      write operation.  In the worst case that array of iovecs could have
      hundreds of elements (the maximum rwsize divided by the page size), so
      it's too big to put on the stack, or in each compound op.  So we instead
      keep a single such array in the compound argument.
      
      We fill in that array at the time we decode the xdr operation.
      
      But we decode every op in the compound before executing any of them.  So
      once we've used that array we can't decode another write.
      
      If we instead delay filling in that array till the time we actually
      perform the write, we can reuse it.
      
      Another option might be to switch to decoding compound ops one at a
      time.  I considered doing that, but it has a number of other side
      effects, and I'd rather fix just this one problem for now.
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      ffe1137b
  27. 15 11月, 2012 1 次提交