1. 27 Dec, 2021 1 commit
    • Rick Macklem's avatar
      nfscommon: Add arguments for support of the dacl attribute · 0fa074b5
      Rick Macklem authored
      NFSv4.1/4.2 has an alternative to the acl attribute, called
      dacl, that includes support for the ACL_ENTRY_INHERITED flag,
      called NFSV4ACE_INHERITED in NFSv4.
      
      This patch adds a dacl argument to nfsrv_buildacl(),
      nfsrv_dissectacl() and nfsrv_dissectace(), so that they
      will handle NFSV4ACE_INHERITED when dacl == true.
      
      Since these functions are always called with dacl == false
      for this patch, semantics should not have changed.
      A future patch will add support for dacl.
      
      MFC after:	2 weeks
      0fa074b5
  2. 12 Dec, 2021 1 commit
    • Rick Macklem's avatar
      nfscl: Fix must_commit handling for mirrored pNFS mounts · 24947b70
      Rick Macklem authored
      For pNFS mounts to mirrored Flexible File layout pNFS servers,
      the "must_commit" component in the nfsclwritedsdorpc
      structure must be checked and the "must_commit" argument passed
      into nfscl_doiods() must be updated.  Technically, only writes to
      the DS with a writeverf change must be redone, but since this
      occurrence will be rare, the must_commit argument to nfscl_doiosd()
      is set to 1, so all writes to all DSs will be redone.
      
      This bug would affect few, since use of mirrored pNFS servers
      is rare and "writeverf" rarely changes. Normally "writeverf"
      only changes when a NFS server reboots.
      
      MFC after:	2 weeks
      24947b70
  3. 11 Dec, 2021 1 commit
    • Rick Macklem's avatar
      nfscl: Fix must_commit/writeverf handling for Direct I/O · ead50c94
      Rick Macklem authored
      Without this patch, the KASSERT(must_commit == 0,..) can be
      triggered by the writeverf in the Direct I/O write reply changing.
      This is not a situation that should cause a panic(). Correct
      handling is to ignore the change in "writeverf" for Direct
      I/O, since it is done with NFSWRITE_FILESYNC.
      
      This patch modifies the semantics of the "must_commit"
      argument slightly, allowing an initial value of 2 to indicate
      that a change in "writeverf" should be ignored.
      It also fixes the KASSERT()s.
      
      This bug would affect few, since Direct I/O is not enabled
      by default and "writeverf" rarely changes. Normally "writeverf"
      only changes when a NFS server reboots, however I found the
      bug when testing against a Linux 5.15.1 kernel nfsd, which
      replied to a NFSWRITE_FILESYNC write with a "writeverf" of all
      0x0 bytes.
      
      MFC after:	2 weeks
      ead50c94
  4. 09 Dec, 2021 1 commit
    • Rick Macklem's avatar
      nfscl: Check for an error return from nfsrv_getattrbits() · ab639f23
      Rick Macklem authored
      There were two places where the client code did not check
      for a parse error return from nfsrv_getattrbits().
      
      This patch fixes both of these cases.
      
      Reported by:	rtm@lcs.mit.edu
      Tested by:	rtm@lcs.mit.edu
      PR:	260272
      MFC after:	2 weeks
      ab639f23
  5. 26 Nov, 2021 1 commit
  6. 11 Nov, 2021 1 commit
    • Rick Macklem's avatar
      nfscl: Add a LayoutError RPC for NFSv4.2 pNFS mounts · 44744f75
      Rick Macklem authored
      If a pNFS server's DS runs out of disk space, it replies
      NFSERR_NOSPC to the client doing writing.  For the Linux
      client, it then sends a LayoutError RPC to the MDS server to
      tell it about the error.  This patch adds the same to the
      FreeBSD NFSv4.2 pNFS client, to maintain Linux compatible
      behaviour, particlularily for non-FreeBSD pNFS servers.
      
      MFC after:	2 weeks
      44744f75
  7. 30 Oct, 2021 1 commit
    • Rick Macklem's avatar
      PR#259071 provides a test program that fails for the NFS client. · 2be41784
      Rick Macklem authored
      Testing with it, there appears to be a race between Lookup
      and VOPs like Setattr-of-size, where Lookup ends up loading
      stale attributes (including what might be the wrong file size)
      into the NFS vnode's attribute cache.
      
      The race occurs when the modifying VOP (which holds a lock
      on the vnode), blocks the acquisition of the vnode in Lookup,
      after the RPC (with now potentially stale attributes).
      
      Here's what seems to happen:
      Child                                Parent
      
      does stat(), which does
      VOP_LOOKUP(), doing the Lookup
      RPC with the directory vnode
      locked, acquiring file attributes
      valid at this point in time
      
      blocks waiting for locked file       does ftruncate(), which
      vnode                                does VOP_SETATTR() of Size,
                                           changing the file's size
                                           while holding an exclusive
                                           lock on the file's vnode
                                           releases the vnode lock
      acquires file vnode and fills in
      now stale attributes including
      the old wrong Size
                                           does a read() which returns
                                           wrong data size
      
      This patch fixes the problem by saving a timestamp in the NFS vnode
      in the VOPs that modify the file (Setattr-of-size, Allocate).
      Then lookup/readdirplus compares that timestamp with the time just
      before starting the RPC after it has acquired the file's vnode.
      If the modifying RPC occurred during the Lookup, the attributes
      in the RPC reply are discarded, since they might be stale.
      
      With this patch the test program works as expected.
      
      Note that the test program does not fail on a July stable/12,
      although this race is in the NFS client code.  I suspect a
      fairly recent change to the name caching code exposed this
      bug.
      
      PR:	259071
      Reviewed by:	asomers
      MFC after:	2 weeks
      Differential Revision:	https://reviews.freebsd.org/D32635
      2be41784
  8. 26 Oct, 2021 1 commit
    • Rick Macklem's avatar
      nfscl: Add a missing delegation lock release · 23024f00
      Rick Macklem authored
      There was a case in nfscl_doiods() where the function would return
      without releasing the delegation shared lock, if it was aquired by
      the call to nfscl_getstateid().  This patch adds that release.
      
      I have never observed a failure due to this missing release, so I
      do not know if it ever happens in practice.  However, since the pNFS
      client is not yet heavily used, it might be the case.
      
      Found by code inspection during a recent NFSv4 IETF working group
      testing event.
      
      MFC after:	2 week
      23024f00
  9. 20 Oct, 2021 1 commit
  10. 18 Oct, 2021 2 commits
    • Rick Macklem's avatar
      nfscl: Handle NFSv4.1/4.2 Close RPC NFSERR_DELAY replies better · 52dee2bc
      Rick Macklem authored
      Without this patch, if a NFSv4.1/4.2 server replies NFSERR_DELAY to
      a Close operation, the client loops retrying the Close while holding
      a shared lock on the clientID.  This shared lock blocks returns of
      delegations, even though the server has issued a CB_RECALL to request
      the delegation return.
      
      This patch delays doing a retry of a Close that received a reply of
      NFSERR_DELAY until after the shared lock on the clientID is released,
      for NFSv4.1/4.2.  To fix this for NFSv4.0 would be very difficult and
      since the only known NFSv4 server to reply NFSERR_DELAY to Close only
      does NFSv4.1/4.2, this fix is hoped to be sufficient.
      
      This problem was detected during a recent IETF working group NFSv4
      testing event.
      
      MFC after:	2 week
      52dee2bc
    • Rick Macklem's avatar
      nfscl: Modify Close RPC so that it does not use "owner" for NFSv4.1/4.2 · d95c0a12
      Rick Macklem authored
      This patch modifies the function that does the Close RPC (nfsrpc_closerpc)
      so that it does not use the open_owner (nfso_own) for NFSv4.1/4.2.
      Use of the seqid in the open_owner structure is only needed for NFSv4.0.
      Same applies to a NFSERR_STALESTATEID reply, which should only happen
      for NFSv4.0.  This allows nfsrpc_closerpc() to be called when nfso_own
      is no longer valid.  This, in turn, allows nfsrpc_closerpc() to be called
      after the shared lock on the clientID is released, for NFSv4.1/4.2.
      
      This is being done to prepare the code for a future patch that fixes
      the case where an NFSv4.1/4.2 server replies NFSERR_DELAY to a Close
      operation.
      
      MFC after:	2 week
      d95c0a12
  11. 16 Oct, 2021 1 commit
    • Rick Macklem's avatar
      nfscl: Move release of the clientID lock into nfscl_doclose() · e2aab5e2
      Rick Macklem authored
      This patch moves release of the shared clientID lock from nfsrpc_close()
      just after the nfscl_doclose() call to the end of nfscl_doclose() call.
      This does make the code cleaner, since the shared lock is acquired at
      the beginning of nfscl_doclose().  The only semantics change is that
      the code no longer drops and reaquires the NFSCLSTATELOCK() mutex,
      which I do not believe will have a negative effect on the NFSv4 client.
      
      This is being done to prepare the code for a future patch that fixes
      the case where an NFSv4.1/4.2 server replies NFSERR_DELAY to a Close
      operation.
      
      MFC after:	2 week
      e2aab5e2
  12. 15 Oct, 2021 2 commits
    • Rick Macklem's avatar
      nfscl: Add an argument to nfscl_tryclose() · 77c595ce
      Rick Macklem authored
      This patch adds a new argument to nfscl_tryclose() to indicate
      whether or not it should loop when a NFSERR_DELAY reply is received
      from the NFSv4 server.  Since this new argument is always passed in
      as "true" at this time, no semantics change should occur.
      
      This is being done to prepare the code for a future patch that fixes
      the case where an NFSv4.1/4.2 server replies NFSERR_DELAY to a Close
      operation.
      
      MFC after:	2 week
      77c595ce
    • Rick Macklem's avatar
      nfscl: Restructure nfscl_freeopen() slightly · 6495766a
      Rick Macklem authored
      This patch factors the unlinking of the nfsclopen structure out of
      nfscl_freeopen() into a separate function called nfscl_unlinkopen().
      It also adds a new argument to nfscl_freeopen() to conditionally do
      the unlink.  Since this new argument is always passed in as "true"
      at this time, no semantics change should occur.
      
      This is being done to prepare the code for a future patch that fixes
      the case where an NFSv4.1/4.2 server replies NFSERR_DELAY to a Close
      operation.
      
      MFC after:	2 week
      6495766a
  13. 13 Oct, 2021 1 commit
    • Rick Macklem's avatar
      nfscl: Make nfscl_getlayout() acquire the correct pNFS layout · 24af0fcd
      Rick Macklem authored
      Without this patch, if a pNFS read layout has already been acquired
      for a file, writes would be redirected to the Metadata Server (MDS),
      because nfscl_getlayout() would not acquire a read/write layout for
      the file.  This happened because there was no "mode" argument to
      nfscl_getlayout() to indicate whether reading or writing was being done.
      Since doing I/O through the Metadata Server is not encouraged for some
      pNFS servers, it is preferable to get a read/write layout for writes
      instead of redirecting the write to the MDS.
      
      This patch adds a access mode argument to nfscl_getlayout() and
      nfsrpc_getlayout(), so that nfscl_getlayout() knows to acquire a read/write
      layout for writing, even if a read layout has already been acquired.
      This patch only affects NFSv4.1/4.2 client behaviour when pNFS ("pnfs" mount
      option against a server that supports pNFS) is in use.
      
      This problem was detected during a recent NFSv4 interoperability
      testing event held by the IETF working group.
      
      MFC after:	2 week
      24af0fcd
  14. 12 Oct, 2021 1 commit
    • Rick Macklem's avatar
      nfscl: Fix a deadlock related to the NFSv4 clientID lock · 120b20bd
      Rick Macklem authored
      Without this patch, it is possible for a process doing an NFSv4
      Open/create of a file to block to allow another process
      to acquire the exclusive lock on the clientID when holding
      a shared lock on the clientID.  As such, both processes
      deadlock, with one wanting the exclusive lock, while the
      other holds the shared lock.  This deadlock is unlikely to occur
      unless delegations are in use on the NFSv4 mount.
      
      This patch fixes the problem by not deferring to the process
      waiting for the exclusive lock when a shared lock (reference cnt)
      is already held by the process.
      
      This problem was detected during a recent NFSv4 interoperability
      testing event held by the IETF working group.
      
      MFC after:	1 week
      120b20bd
  15. 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
  16. 28 Aug, 2021 1 commit
  17. 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
  18. 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
  19. 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
  20. 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
  21. 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
  22. 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
  23. 04 May, 2021 1 commit
  24. 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
  25. 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
  26. 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
  27. 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
  28. 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
  29. 01 Sep, 2020 1 commit
  30. 18 Aug, 2020 1 commit
  31. 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
  32. 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
  33. 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
  34. 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
  35. 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
  36. 17 Jun, 2020 1 commit
  37. 12 May, 2020 1 commit
  38. 08 May, 2020 1 commit