1. 11 Sep, 2021 1 commit
    • Rick Macklem's avatar
      nfscl: Make vfs.nfs.maxcopyrange larger by default · 55089ef4
      Rick Macklem authored
      As of commit 103b2075, the NFSv4.2 server will limit the size
      of a Copy operation based upon a 1 second timeout.  The Linux 5.2
      kernel server also limits Copy operation size to 4Mbytes.
      As such, the NFSv4.2 client can attempt a large Copy without
      resulting in a long RPC RTT for these servers.
      
      This patch changes vfs.nfs.maxcopyrange to 64bits and sets
      the default to the maximum possible size of SSIZE_MAX, since
      a larger size makes the Copy operation more efficient and
      allows for copying to complete with fewer RPCs.
      The sysctl may be need to be made smaller for other non-FreeBSD
      NFSv4.2 servers.
      
      MFC after:	2 weeks
      55089ef4
  2. 28 Aug, 2021 1 commit
  3. 12 Aug, 2021 1 commit
    • Rick Macklem's avatar
      nfscl: Add a Lookup+Open RPC for NFSv4.1/4.2 · 3ad1e1c1
      Rick Macklem authored
      This patch adds a Lookup+Open compound RPC to the NFSv4.1/4.2
      NFS client, which can be used by nfs_lookup() so that a
      subsequent Open RPC is not required.
      It uses the cn_flags OPENREAD, OPENWRITE added by commit c18c74a8.
      This reduced the number of RPCs by about 15% for a kernel
      build over NFS.
      
      For now, use of Lookup+Open is only done when the "oneopenown"
      mount option is used.  It may be possible for Lookup+Open to
      be used for non-oneopenown NFSv4.1/4.2 mounts, but that will
      require extensive further testing to determine if it works.
      
      While here, I've added the changes to the nfscommon module
      that are needed to implement the Deallocate NFSv4.2 operation.
      This avoids needing another cycle of changes to the internal
      KAPI between the NFS modules.
      
      This commit has changed the internal KAPI between the NFS
      modules and, as such, all need to be rebuilt from sources.
      I have not bumped __FreeBSD_version, since it was bumped a
      few days ago.
      3ad1e1c1
  4. 28 Jul, 2021 1 commit
    • Rick Macklem's avatar
      nfscl: Cache an open stateid for the "oneopenown" mount option · efea1bc1
      Rick Macklem authored
      For NFSv4.1/4.2, if the "oneopenown" mount option is used,
      there is, at most, only one open stateid for each NFS vnode.
      When an open stateid for a file is acquired, set a pointer to
      the open structure in the NFS vnode.  This pointer can be used to
      acquire the open stateid without searching the open linked list
      when the following is true:
      - No delegations have been issued for the file.  Since delegations
        can outlive an NFS vnode for a file, use the global
        NFSMNTP_DELEGISSUED flag on the mount to determine this.
      - No lock stateid has been issued for the file.  To determine
        this, a new NFS vnode flag called NMIGHTBELOCKED is set when a lock
        stateid is issued, which can then be tested.
      
      When this open structure pointer can be used, it avoids the need to
      acquire the NFSCLSTATELOCK() and searching the open structure list for
      an open.  The NFSCLSTATELOCK() can be highly contended when there are
      a lot of opens issued for the NFSv4.1/4.2 mount.
      
      This patch only affects NFSv4.1/4.2 mounts when the "oneopenown"
      mount option is used.
      
      MFC after:	2 weeks
      efea1bc1
  5. 14 Jul, 2021 1 commit
    • Rick Macklem's avatar
      nfscl: Avoid KASSERT() panic in cache_enter_time() · 7f5508fe
      Rick Macklem authored
      Commit 844aa31c added cache_enter_time_flags(), specifically
      so that the NFS client could specify that cache enter replace
      any stale entry for the same name.  Doing so avoids a KASSERT()
      panic() in cache_enter_time(), as reported by the PR.
      
      This patch uses cache_enter_time_flags() for Readdirplus, to
      avoid the panic(), since it is impossible for the NFS client
      to know if another client (or a local process on the NFS server)
      has replaced a file with another file of the same name.
      
      This patch only affects NFS mounts that use the "rdirplus"
      mount option.
      
      There may be other places in the NFS client where this needs
      to be done, but no panic() has been observed during testing.
      
      PR:	257043
      MFC after:	2 weeks
      7f5508fe
  6. 09 Jul, 2021 1 commit
    • Rick Macklem's avatar
      nfscl: Add a Linux compatible "nconnect" mount option · 1e0a518d
      Rick Macklem authored
      Linux has had an "nconnect" NFS mount option for some time.
      It specifies that N (up to 16) TCP connections are to created for a mount,
      instead of just one TCP connection.
      
      A discussion on freebsd-net@ indicated that this could improve
      client<-->server network bandwidth, if either the client or server
      have one of the following:
      - multiple network ports aggregated to-gether with lagg/lacp.
      - a fast NIC that is using multiple queues
      It does result in using more IP port#s and might increase server
      peak load for a client.
      
      One difference from the Linux implementation is that this implementation
      uses the first TCP connection for all RPCs composed of small messages
      and uses the additional TCP connections for RPCs that normally have
      large messages (Read/Readdir/Write).  The Linux implementation spreads
      all RPCs across all TCP connections in a round robin fashion, whereas
      this implementation spreads Read/Readdir/Write across the additional
      TCP connections in a round robin fashion.
      
      Reviewed by:	markj
      MFC after:	2 weeks
      Differential Revision:	https://reviews.freebsd.org/D30970
      1e0a518d
  7. 16 Jun, 2021 1 commit
    • Rick Macklem's avatar
      nfscl: Make NFSv4.0 client acquisition NFSv4.1/4.2 compatible · aed98fa5
      Rick Macklem authored
      When the NFSv4.0 client was implemented, acquisition of a clientid
      via SetClientID/SetClientIDConfirm was done upon the first Open,
      since that was when it was needed.  NFSv4.1/4.2 acquires the clientid
      during mount (via ExchangeID/CreateSession), since the associated
      session is required during mount.
      
      This patch modifies the NFSv4.0 mount so that it acquires the
      clientid during mount.  This simplifies the code and makes it
      easy to implement "find the highest minor version supported by
      the NFSv4 server", which will be done for the default minorversion
      in a future commit.
      The "start_renewthread" argument for nfscl_getcl() is replaced
      by "tryminvers", which will be used by the aforementioned
      future commit.
      
      MFC after:	2 weeks
      aed98fa5
  8. 08 May, 2021 1 commit
    • Rick Macklem's avatar
      nfscl: Add support for va_birthtime to NFSv4 · dd02d9d6
      Rick Macklem authored
      There is a NFSv4 file attribute called TimeCreate
      that can be used for va_birthtime.
      r362175 added some support for use of TimeCreate.
      This patch completes support of va_birthtime by adding
      support for setting this attribute to the server.
      It also eanbles the client to
      acquire and set the attribute for a NFSv4
      server that supports the attribute.
      
      Reviewed by:	markj
      MFC after:	2 weeks
      Differential Revision:	https://reviews.freebsd.org/D30156
      dd02d9d6
  9. 04 May, 2021 1 commit
  10. 11 Apr, 2021 1 commit
    • Rick Macklem's avatar
      nfsv4 client: do the BindConnectionToSession as required · 7763814f
      Rick Macklem authored
      During a recent testing event, it was reported that the NFSv4.1/4.2
      server erroneously bound the back channel to a new TCP connection.
      RFC5661 specifies that the fore channel is implicitly bound to a
      new TCP connection when an RPC with Sequence (almost any of them)
      is done on it.  For the back channel to be bound to the new TCP
      connection, an explicit BindConnectionToSession must be done as
      the first RPC on the new connection.
      
      Since new TCP connections are created by the "reconnect" layer
      (sys/rpc/clnt_rc.c) of the krpc, this patch adds an optional
      upcall done by the krpc whenever a new connection is created.
      The patch also adds the specific upcall function that does a
      BindConnectionToSession and configures the krpc to call it
      when required.
      
      This is necessary for correct interoperability with NFSv4.1/NFSv4.2
      servers when the nfscbd daemon is running.
      
      If doing NFSv4.1/NFSv4.2 mounts without this patch, it is
      recommended that the nfscbd daemon not be running and that
      the "pnfs" mount option not be specified.
      
      PR:	254840
      Comments by:	asomers
      MFC after:	2 weeks
      Differential Revision:	https://reviews.freebsd.org/D29475
      7763814f
  11. 13 Mar, 2021 1 commit
    • Gordon Bergling's avatar
      Fix some common typos in comments · 5666643a
      Gordon Bergling authored
      - occured -> occurred
      - normaly -> normally
      - controling -> controlling
      - fileds -> fields
      - insterted -> inserted
      - outputing -> outputting
      
      MFC after:	1 week
      5666643a
  12. 02 Mar, 2021 1 commit
    • Rick Macklem's avatar
      nfsclient: Fix ReadDS/WriteDS/CommitDS nfsstats RPC counts for a NFSv3 DS · c04199af
      Rick Macklem authored
      During a recent virtual NFSv4 testing event, a bug in the FreeBSD client
      was detected when doing I/O DS operations on a Flexible File Layout pNFS
      server.  For an NFSv3 DS, the Read/Write/Commit nfsstats were incremented
      instead of the ReadDS/WriteDS/CommitDS counts.
      This patch fixes this.
      
      Only the RPC counts reported by nfsstat(1) were affected by this bug,
      the I/O operations were performed correctly.
      
      MFC after:	2 weeks
      c04199af
  13. 01 Mar, 2021 1 commit
    • Rick Macklem's avatar
      nfsclient: Fix the stripe unit size for a File Layout pNFS layout · 94f2e42f
      Rick Macklem authored
      During a recent virtual NFSv4 testing event, a bug in the FreeBSD client
      was detected when doing a File Layout pNFS DS I/O operation.
      The size of the I/O operation was smaller than expected.
      The I/O size is specified as a stripe unit size in bits 6->31 of nflh_util
      in the layout.  I had misinterpreted RFC5661 and had shifted the value
      right by 6 bits. The correct interpretation is to use the value as
      presented (it is always an exact multiple of 64), clearing bits 0->5.
      This patch fixes this.
      
      Without the patch, I/O through the DSs work, but the I/O size is 1/64th
      of what is optimal.
      
      MFC after:	2 weeks
      94f2e42f
  14. 28 Feb, 2021 1 commit
    • Rick Macklem's avatar
      nfsclient: fix panic in cache_enter_time() · 3fe2c68b
      Rick Macklem authored
      Juraj Lutter (otis@) reported a panic "dvp != vp not true" in
      cache_enter_time() called from the NFS client's nfsrpc_readdirplus()
      function.
      This is specific to an NFSv3 mount with the "rdirplus" mount
      option. Unlike NFSv4, NFSv3 replies to ReaddirPlus
      includes entries for the current directory.
      
      This trivial patch avoids doing a cache_enter_time()
      call for the current directory to avoid the panic.
      
      Reported by:	otis
      Tested by:	otis
      Reviewed by:	mjg
      MFC after:	3 days
      Differential Revision:	https://reviews.freebsd.org/D28969
      3fe2c68b
  15. 01 Sep, 2020 1 commit
  16. 18 Aug, 2020 1 commit
  17. 11 Aug, 2020 1 commit
    • Rick Macklem's avatar
      Add an argument to newnfs_connect() that indicates use TLS for the connection. · 02511d21
      Rick Macklem authored
      For NFSv4.0, the server creates a server->client TCP connection for callbacks.
      If the client mount on the server is using TLS, enable TLS for this callback
      TCP connection.
      TLS connections from clients will not be supported until the kernel RPC
      changes are committed.
      
      Since this changes the internal ABI between the NFS kernel modules that
      will require a version bump, delete newnfs_trimtrailing(), which is no
      longer used.
      
      Since LCL_TLSCB is not yet set, these changes should not have any semantic
      affect at this time.
      02511d21
  18. 24 Jul, 2020 1 commit
    • Rick Macklem's avatar
      Add support for ext_pgs mbufs to nfsm_uiombuflist() and nfsm_split(). · cfaafa79
      Rick Macklem authored
      This patch uses a slightly different algorithm for nfsm_uiombuflist() for
      the non-ext_pgs case, where a variable called "mcp" is maintained, pointing to
      the current location that mbuf data can be filled into. This avoids use of
      mtod(mp, char *) + mp->m_len to calculate the location, since this does
      not work for ext_pgs mbufs and I think it makes the algorithm more readable.
      This change should not result in semantic changes for the non-ext_pgs case.
      The patch also deletes come unneeded code.
      
      It also adds support for anonymous page ext_pgs mbufs to nfsm_split().
      
      This is another in the series of commits that add support to the NFS client
      and server for building RPC messages in ext_pgs mbufs with anonymous pages.
      This is useful so that the entire mbuf list does not need to be
      copied before calling sosend() when NFS over TLS is enabled.
      At this time for this case, use of ext_pgs mbufs cannot be enabled, since
      ktls_encrypt() replaces the unencrypted data with encrypted data in place.
      
      Until such time as this can be enabled, there should be no semantic change.
      Also, note that this code is only used by the NFS client for a mirrored pNFS
      server.
      cfaafa79
  19. 22 Jul, 2020 1 commit
    • Rick Macklem's avatar
      Modify writing to mirrored pNFS DSs to prepare for use of ext_pgs mbufs. · 9516bcdf
      Rick Macklem authored
      This patch modifies writing to mirrored pNFS DSs slightly so that there is
      only one m_copym() call for a mirrored pair instead of two of them.
      This call replaces the custom nfsm_copym() call, which is no longer needed
      and deleted by this patch. The patch does introduce a new nfsm_split()
      function that only calls m_split() for the non-ext_pgs case.
      The semantics of nfsm_uiombuflist() is changed to include code that nul
      pads the generated mbuf list. This was done by nfsm_copym() prior to this patch.
      
      The main reason for this change is that it allows the data to be a list
      of ext_pgs mbufs, since the m_copym() is for the entire mbuf list.
      This support will be added in a future commit.
      
      This patch only affects writing to mirrored flexible file layout pNFS servers.
      9516bcdf
  20. 15 Jul, 2020 1 commit
    • Rick Macklem's avatar
      Fix the pNFS flexible file layout client for servers with small write size. · 7477442f
      Rick Macklem authored
      The code in nfscl_dofflayout() loops when a flexible file layout server
      provides a small write data limit (no extant server is known to do this).
      If/when it looped, it erroneously reused the "drpc" argument for the
      mirror worker thread, corrupting it.
      This patch fixes the problem by only using the calling thread after the
      first loop iteration.
      
      Found during testing by simulating a server with a small write size.
      
      Since no extant pNFS server is known to provide a small write size,
      this fix it not needed in practice at this time.
      
      MFC after:	2 weeks
      7477442f
  21. 26 Jun, 2020 1 commit
    • Rick Macklem's avatar
      Add a boolean argument to nfscl_reqstart() to indicate that ext_pgs mbufs · 4476c1de
      Rick Macklem authored
      should be used.
      
      For KERN_TLS (and possibly some other future network interface) the mbuf
      list passed into sosend() must be ext_pgs mbufs. The krpc could simply
      copy all the mbuf data into ext_pgs mbufs before calling sosend(), but
      that would be inefficient for large RPC messages.
      This patch adds an argument to nfscl_reqstart() to indicate that it should
      fill the RPC message into ext_pgs mbufs.
      It also adds fields to "struct nfsrv_descript" needed for building NFS RPC
      messages in ext_pgs mbufs, along with new flags for this.
      
      Since the argument is always "false", this commit should not result in any
      semantic change. However, this commit prepares the code
      for future commits that will add support for building of NFS RPC messages
      in ext_pgs mbufs.
      4476c1de
  22. 17 Jun, 2020 1 commit
  23. 12 May, 2020 1 commit
  24. 08 May, 2020 1 commit
  25. 28 Apr, 2020 1 commit
    • Rick Macklem's avatar
      Get rid of uio_XXX macros used for the Mac OS/X port. · 5ecf33c6
      Rick Macklem authored
      The NFS code had a bunch of Mac OS/X accessor functions named uio_XXX
      left over from the port to Mac OS/X. Since that port is long forgotten,
      replace the calls with the code generated by the FreeBSD macros for these
      in nfskpiport.h. This allows the macros to be deleted from nfskpiport.h
      and I think makes the code more readable.
      
      This patch should not result in any semantic change.
      5ecf33c6
  26. 22 Apr, 2020 1 commit
    • Rick Macklem's avatar
      Make the NFSv4.n client's recovery from NFSERR_BADSESSION RFC5661 conformant. · 897d7d45
      Rick Macklem authored
      RFC5661 specifies that a client's recovery upon receipt of NFSERR_BADSESSION
      should first consist of a CreateSession operation using the extant ClientID.
      If that fails, then a full recovery beginning with the ExchangeID operation
      is to be done.
      Without this patch, the FreeBSD client did not attempt the CreateSession
      operation with the extant ClientID and went directly to a full recovery
      beginning with ExchangeID. I have had this patch several years, but since
      no extant NFSv4.n server required the CreateSession with extant ClientID,
      I have never committed it.
      I an committing it now, since I suspect some future NFSv4.n server will
      require this and it should not negatively impact recovery for extant NFSv4.n
      servers, since they should all return NFSERR_STATECLIENTID for this first
      CreateSession.
      
      The patched client has been tested for recovery against both the FreeBSD
      and Linux NFSv4.n servers and no problems have been observed.
      
      MFC after:	1 month
      897d7d45
  27. 15 Apr, 2020 1 commit
    • Rick Macklem's avatar
      Fix the NFSv4.2 extended attribute support for remove extended attrbute. · 0bda1ddd
      Rick Macklem authored
      I missed the "atomic" field of the RemoveExtendedAttribute operation's
      reply when I implemented it. It worked between FreeBSD client and server,
      since it was missed for both, but it did not conform to RFC 8276.
      This patch adds the field for both client and server.
      
      Thanks go to Frank for doing interoperability testing of the extended
      attribute support against patches for Linux.
      
      Submitted by:	Frank van der Linden <fllinden@amazon.com>
      Reported by:	Frank van der Linden <fllinden@amazon.com>
      0bda1ddd
  28. 14 Apr, 2020 1 commit
    • Rick Macklem's avatar
      Fix the NFSv2 extended attribute support to handle 0 length attributes. · fb8ed4c5
      Rick Macklem authored
      I did not realize that zero length attributes are allowed, but they are.
      This patch fixes the NFSv4.2 client and server to handle zero length
      extended attributes correctly.
      
      Submitted by:	Frank van der Linden <fllinden@amazon.com> (earlier version)
      Reported by:	Frank van der Linden <fllinder@amazon.com>
      fb8ed4c5
  29. 11 Apr, 2020 1 commit
    • Rick Macklem's avatar
      Replace mbuf macros with the code they would generate in the NFS code. · e3e7c612
      Rick Macklem authored
      When the code was ported to Mac OS/X, mbuf handling functions were
      converted to using the Mac OS/X accessor functions. For FreeBSD, they
      are a simple set of macros in sys/fs/nfs/nfskpiport.h.
      Since porting to Mac OS/X is no longer a consideration, replacement of
      these macros with the code generated by them makes the code more
      readable.
      When support for external page mbufs is added as needed by the KERN_TLS,
      the patch becomes simpler if done without the macros.
      
      This patch should not result in any semantic change.
      
      This is the final patch of this series and the macros should now be
      able to be deleted from the .h files in a future commit.
      e3e7c612
  30. 13 Dec, 2019 1 commit
  31. 12 Dec, 2019 1 commit
    • Rick Macklem's avatar
      Add support for NFSv4.2 to the NFS client and server. · c057a378
      Rick Macklem authored
      This patch adds support for NFSv4.2 (RFC-7862) and Extended Attributes
      (RFC-8276) to the NFS client and server.
      NFSv4.2 is comprised of several optional features that can be supported
      in addition to NFSv4.1. This patch adds the following optional features:
         - posix_fadvise(POSIX_FADV_WILLNEED/POSIX_FADV_DONTNEED)
         - posix_fallocate()
         - intra server file range copying via the copy_file_range(2) syscall
           --> Avoiding data tranfer over the wire to/from the NFS client.
         - lseek(SEEK_DATA/SEEK_HOLE)
         - Extended attribute syscalls for "user" namespace attributes as defined
           by RFC-8276.
      
      Although this patch is fairly large, it should not affect support for
      the other versions of NFS. However it does add two new sysctls that allow
      a sysadmin to limit which minor versions of NFSv4 a server supports, allowing
      a sysadmin to disable NFSv4.2.
      
      Unfortunately, when the NFS stats structure was last revised, it was assumed
      that there would be no additional operations added beyond what was
      specified in RFC-7862. However RFC-8276 did add additional operations,
      forcing the NFS stats structure to revised again. It now has extra unused
      entries in all arrays, so that future extensions to NFSv4.2 can be
      accomodated without revising this structure again.
      
      A future commit will update nfsstat(1) to report counts for the new NFSv4.2
      specific operations/procedures.
      
      This patch affects the internal interface between the nfscommon, nfscl and
      nfsd modules and, as such, they all must be upgraded simultaneously.
      I will do a version bump (although arguably not needed), due to this.
      
      This code has survived a "make universe" but has not been built with a
      recent GCC. If you encounter build problems, please email me.
      
      Relnotes:	yes
      c057a378
  32. 24 Sep, 2019 1 commit
    • Rick Macklem's avatar
      Replace all mtx_lock()/mtx_unlock() on n_mtx with the macros. · 5d85e12f
      Rick Macklem authored
      For a long time, some places in the NFS code have locked/unlocked the
      NFS node lock with the macros NFSLOCKNODE()/NFSUNLOCKNODE() whereas
      others have simply used mtx_lock()/mtx_unlock().
      Since the NFS node mutex needs to change to an sx lock so it can be held when
      vnode_pager_setsize() is called, replace all occurrences of mtx_lock/mtx_unlock
      with the macros to simply making the change to an sx lock in future commit.
      There is no semantic change as a result of this commit.
      
      I am not sure if the change to an sx lock will be MFC'd soon, so I put
      an MFC of 1 week on this commit so that it could be MFC'd with that commit.
      
      Suggested by:	kib
      MFC after:	1 week
      5d85e12f
  33. 12 Mar, 2019 2 commits
  34. 23 Nov, 2018 1 commit
    • Rick Macklem's avatar
      Make sure the NFS readdir client fills in all "struct dirent" data. · f86bce17
      Rick Macklem authored
      The NFS client code (nfsrpc_readdir() and nfsrpc_readdirplus()) wasn't
      filling in parts of the readdir reply, such as d_pad[01] and the bytes
      at the end of d_name within d_reclen. As such, data left in a buffer cache
      block could be leaked to userland in the readdir reply.
      This patch makes sure all of the data is filled in.
      
      Reported by:	Thomas Barabosch, Fraunhofer FKIE
      Reviewed by:	kib, markj
      MFC after:	2 weeks
      f86bce17
  35. 02 Nov, 2018 1 commit
    • Brooks Davis's avatar
      Make vop_symlink take a const target path. · 1493c2ee
      Brooks Davis authored
      This will enable callers to take const paths as part of syscall
      decleration improvements.
      
      Where doing so is easy and non-distruptive carry the const through
      implementations. In UFS the value is passed to an interface that must
      take non-const values. In ZFS, const poisoning would touch code shared
      with upstream and it's not worth adding diffs.
      
      Bump __FreeBSD_version for external API consumers.
      
      Reviewed by:	kib (prior version)
      Obtained from:	CheriBSD
      Sponsored by:	DARPA, AFRL
      Differential Revision:	https://reviews.freebsd.org/D17805
      1493c2ee
  36. 02 Aug, 2018 1 commit
    • Rick Macklem's avatar
      Silence newer gcc warnings. · ac0d6495
      Rick Macklem authored
      Newer versions of gcc generate "might not be initialized" warnings for
      several variables in nfsrpc_doiods().  I have checked and all of these
      variables are assigned values before they are used.
      In the one case of "tdrpc", it could have passed garbage as an argument
      to nfscl_dofflayoutio() when mirrorcnt is one. However nfscl_dofflayoutio() only
      uses the argument when mirrorcnt > 1, so it wasn't actually broken.
      This patch initializes "tdrpc" to avoid confusion and initializes the rest
      to make the compiler happy.
      
      Requested by:	mmacy
      ac0d6495
  37. 15 Jul, 2018 1 commit
    • Rick Macklem's avatar
      Shut down the TCP connection to a DS in the pNFS client when Renew fails. · 5da38824
      Rick Macklem authored
      When a NFSv4.1 client mount using pNFS detects a failure trying to do a
      Renew (actually just a Sequence operation), the code would simply try
      again and again and again every 30sec.
      This would tie up the "nfscl" thread, which should also be doing other
      things like Renews on other DSs and the MDS.
      This patch adds code which closes down the TCP connection and marks it
      defunct when Renew detects an failure to communicate with the DS, so
      further Renews will not be attempted until a new working TCP connection to
      the DS is established.
      It also makes the call to nfscl_cancelreqs() unconditional, since
      nfscl_cancelreqs() checks the NFSCLDS_SAMECONN flag and does so while holding
      the lock.
      This fix only applies to the NFSv4.1 client whne using pNFS and without it
      the only effect would have been an "nfscl" thread busy doing Renew attempts
      on an unresponsive DS.
      
      MFC after:	2 weeks
      5da38824
  38. 14 Jul, 2018 1 commit
    • Rick Macklem's avatar
      Fix the pNFS client when mirrors aren't on the same machine. · 89c64a3a
      Rick Macklem authored
      Without this patch, the client side NFSv4.1 pNFS code erroneously did writes
      and commits to both DS mirrors using the TCP connection of the first one.
      For my test setup this worked, since I have both DSs running on the same
      machine, but it would have failed when the DSs are on separate machines.
      This patch fixes the code to use the correct TCP connection for each DS.
      This patch should only affect the NFSv4.1 client when using "pnfs" mounts
      to mirrored DSs.
      
      MFC after:	2 weeks
      89c64a3a
  39. 13 Jul, 2018 1 commit
    • Rick Macklem's avatar
      Change the pNFS client so that it does not report an NFSERR_STALE from · 83f526de
      Rick Macklem authored
      an I/O attempt on a DS to the server via LayoutReturn.
      
      The current FreeBSD client can generate these errors for an operational
      DS while doing a recovery of a mirror after a mirrored DS has been repaired.
      I am not sure why these errors occur, but my best current guess is a race
      between the Layout Recall issued by the kernel code run from pnfsdscopymr(8)
      and a Read operation on the DS for the file bing copied.
      The errrors are not fatal, since the client falls back on doing I/O through
      the MDS, which can do the I/O successfully as a proxy. (The fact that the
      MDS can do this indicates that the file does still exist on the functioning
      DS.)
      This patch only affects behaviour of the pNFS client and only when using
      Flexible File layouts.
      
      MFC after:	2 weeks
      83f526de