1. 25 1月, 2017 1 次提交
    • C
      nfs: Don't increment lock sequence ID after NFS4ERR_MOVED · 059aa734
      Chuck Lever 提交于
      Xuan Qi reports that the Linux NFSv4 client failed to lock a file
      that was migrated. The steps he observed on the wire:
      
      1. The client sent a LOCK request to the source server
      2. The source server replied NFS4ERR_MOVED
      3. The client switched to the destination server
      4. The client sent the same LOCK request to the destination
         server with a bumped lock sequence ID
      5. The destination server rejected the LOCK request with
         NFS4ERR_BAD_SEQID
      
      RFC 3530 section 8.1.5 provides a list of NFS errors which do not
      bump a lock sequence ID.
      
      However, RFC 3530 is now obsoleted by RFC 7530. In RFC 7530 section
      9.1.7, this list has been updated by the addition of NFS4ERR_MOVED.
      Reported-by: NXuan Qi <xuan.qi@oracle.com>
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Cc: stable@vger.kernel.org # v3.7+
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      059aa734
  2. 16 12月, 2016 1 次提交
  3. 10 12月, 2016 1 次提交
  4. 28 9月, 2016 1 次提交
  5. 14 7月, 2016 1 次提交
  6. 18 5月, 2016 3 次提交
    • J
      pnfs: rework LAYOUTGET retry handling · 183d9e7b
      Jeff Layton 提交于
      There are several problems in the way a stateid is selected for a
      LAYOUTGET operation:
      
      We pick a stateid to use in the RPC prepare op, but that makes
      it difficult to serialize LAYOUTGETs that use the open stateid. That
      serialization is done in pnfs_update_layout, which occurs well before
      the rpc_prepare operation.
      
      Between those two events, the i_lock is dropped and reacquired.
      pnfs_update_layout can find that the list has lsegs in it and not do any
      serialization, but then later pnfs_choose_layoutget_stateid ends up
      choosing the open stateid.
      
      This patch changes the client to select the stateid to use in the
      LAYOUTGET earlier, when we're searching for a usable layout segment.
      This way we can do it all while holding the i_lock the first time, and
      ensure that we serialize any LAYOUTGET call that uses a non-layout
      stateid.
      
      This also means a rework of how LAYOUTGET replies are handled, as we
      must now get the latest stateid if we want to retransmit in response
      to a retryable error.
      
      Most of those errors boil down to the fact that the layout state has
      changed in some fashion. Thus, what we really want to do is to re-search
      for a layout when it fails with a retryable error, so that we can avoid
      reissuing the RPC at all if possible.
      
      While the LAYOUTGET RPC is async, the initiating thread always waits for
      it to complete, so it's effectively synchronous anyway. Currently, when
      we need to retry a LAYOUTGET because of an error, we drive that retry
      via the rpc state machine.
      
      This means that once the call has been submitted, it runs until it
      completes. So, we must move the error handling for this RPC out of the
      rpc_call_done operation and into the caller.
      
      In order to handle errors like NFS4ERR_DELAY properly, we must also
      pass a pointer to the sliding timeout, which is now moved to the stack
      in pnfs_update_layout.
      
      The complicating errors are -NFS4ERR_RECALLCONFLICT and
      -NFS4ERR_LAYOUTTRYLATER, as those involve a timeout after which we give
      up and return NULL back to the caller. So, there is some special
      handling for those errors to ensure that the layers driving the retries
      can handle that appropriately.
      Signed-off-by: NJeff Layton <jeff.layton@primarydata.com>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      183d9e7b
    • T
      NFSv4: Label stateids with the type · 93b717fd
      Trond Myklebust 提交于
      In order to more easily distinguish what kind of stateid we are dealing
      with, introduce a type that can be used to label the stateid structure.
      
      The label will be useful both for debugging, but also when dealing with
      operations like SETATTR, READ and WRITE that can take several different
      types of stateid as arguments.
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      93b717fd
    • A
      NFS: Add COPY nfs operation · 2e72448b
      Anna Schumaker 提交于
      This adds the copy_range file_ops function pointer used by the
      sys_copy_range() function call.  This patch only implements sync copies,
      so if an async copy happens we decode the stateid and ignore it.
      Signed-off-by: NAnna Schumaker <bjschuma@netapp.com>
      2e72448b
  7. 18 3月, 2016 1 次提交
  8. 28 12月, 2015 1 次提交
  9. 08 12月, 2015 1 次提交
  10. 16 10月, 2015 2 次提交
  11. 18 8月, 2015 1 次提交
  12. 24 6月, 2015 1 次提交
  13. 22 4月, 2015 1 次提交
  14. 04 2月, 2015 1 次提交
  15. 03 2月, 2015 2 次提交
    • C
      nfsd: implement pNFS operations · 9cf514cc
      Christoph Hellwig 提交于
      Add support for the GETDEVICEINFO, LAYOUTGET, LAYOUTCOMMIT and
      LAYOUTRETURN NFSv4.1 operations, as well as backing code to manage
      outstanding layouts and devices.
      
      Layout management is very straight forward, with a nfs4_layout_stateid
      structure that extends nfs4_stid to manage layout stateids as the
      top-level structure.  It is linked into the nfs4_file and nfs4_client
      structures like the other stateids, and contains a linked list of
      layouts that hang of the stateid.  The actual layout operations are
      implemented in layout drivers that are not part of this commit, but
      will be added later.
      
      The worst part of this commit is the management of the pNFS device IDs,
      which suffers from a specification that is not sanely implementable due
      to the fact that the device-IDs are global and not bound to an export,
      and have a small enough size so that we can't store the fsid portion of
      a file handle, and must never be reused.  As we still do need perform all
      export authentication and validation checks on a device ID passed to
      GETDEVICEINFO we are caught between a rock and a hard place.  To work
      around this issue we add a new hash that maps from a 64-bit integer to a
      fsid so that we can look up the export to authenticate against it,
      a 32-bit integer as a generation that we can bump when changing the device,
      and a currently unused 32-bit integer that could be used in the future
      to handle more than a single device per export.  Entries in this hash
      table are never deleted as we can't reuse the ids anyway, and would have
      a severe lifetime problem anyway as Linux export structures are temporary
      structures that can go away under load.
      
      Parts of the XDR data, structures and marshaling/unmarshaling code, as
      well as many concepts are derived from the old pNFS server implementation
      from Andy Adamson, Benny Halevy, Dean Hildebrand, Marc Eshel, Fred Isaman,
      Mike Sager, Ricardo Labiaga and many others.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      9cf514cc
    • C
      nfs: add LAYOUT_TYPE_MAX enum value · 6cae0a46
      Christoph Hellwig 提交于
      This gives us a nice upper bound for later use in nfѕd.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      6cae0a46
  16. 26 11月, 2014 2 次提交
  17. 01 10月, 2014 1 次提交
  18. 30 9月, 2014 2 次提交
  19. 29 8月, 2014 1 次提交
  20. 07 6月, 2014 1 次提交
  21. 20 11月, 2013 1 次提交
  22. 05 11月, 2013 2 次提交
  23. 31 10月, 2013 1 次提交
  24. 29 10月, 2013 1 次提交
  25. 09 6月, 2013 2 次提交
  26. 13 5月, 2013 1 次提交
  27. 13 2月, 2013 1 次提交
    • E
      nfsd: Handle kuids and kgids in the nfs4acl to posix_acl conversion · ab8e4aee
      Eric W. Biederman 提交于
      In struct nfs4_ace remove the member who and replace it with an
      anonymous union holding who_uid and who_gid.  Allowing typesafe
      storage uids and gids.
      
      Add a helper pace_gt for sorting posix_acl_entries.
      
      In struct posix_user_ace_state to replace uid with a union
      of kuid_t uid and kgid_t gid.
      
      Remove all initializations of the deprecated posic_acl_entry
      e_id field.  Which is not present when user namespaces are enabled.
      
      Split find_uid into two functions find_uid and find_gid that work
      in a typesafe manner.
      
      In nfs4xdr update nfsd4_encode_fattr to deal with the changes
      in struct nfs4_ace.
      
      Rewrite nfsd4_encode_name to take a kuid_t and a kgid_t instead
      of a generic id and flag if it is a group or a uid.  Replace
      the group flag with a test for a valid gid.
      
      Modify nfsd4_encode_user to take a kuid_t and call the modifed
      nfsd4_encode_name.
      
      Modify nfsd4_encode_group to take a kgid_t and call the modified
      nfsd4_encode_name.
      
      Modify nfsd4_encode_aclname to take an ace instead of taking the
      fields of an ace broken out.  This allows it to detect if the ace is
      for a user or a group and to pass the appropriate value while still
      being typesafe.
      
      Cc: "J. Bruce Fields" <bfields@fieldses.org>
      Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      ab8e4aee
  28. 13 10月, 2012 1 次提交
  29. 27 5月, 2012 1 次提交
  30. 26 5月, 2012 1 次提交
  31. 25 5月, 2012 2 次提交